MKmapView removeAllAnnotations question

Discussion in 'iOS Programming' started by MACloop, Dec 16, 2009.

  1. MACloop macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #1
    Hello!
    I have a mapview with some annotations. Those annotations are generated from an xml file and everything is working fine. My problem is that those points to be displayed on the map are changing over time and I want to offer the user the posibility to update them. So I added a button and this button calls the method "updateIt". In this method I remove all the annotations on the map and calls the locationmanager etc again. The annotations are displayed allright but the USERLOCATION does not appear on the map after the update...? I calculate the closest position to the userlocation and defines the map (region etc) anfter tzhis calculation. I also have written myMap.showsuserposition = YES; but nothing is working.

    Any tips on this issue???
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Yes: don't make up properties. There is no such thing as showsuserposition. Or even showsUserPosition. Check the MKMapView documentation to find the correct property name.
     
  3. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #3
    ok, sorry my mistake. I did mean this property and did not have the code in front of me while writing the question.

    "showsUserLocation

    A Boolean value indicating whether the map may display the user location.

    @property (nonatomic) BOOL showsUserLocation

    Discussion

    This property does not indicate whether the user’s position is actually visible on the map, only whether the map view is allowed to display it. To determine whether the user’s position is visible, use the userLocationVisible property. The default value of this property is NO.

    Setting this property to YES causes the map view to use the Core Location framework to find the current location. As long as this property is YES, the map view continues to track the user’s location and update it periodically.
    Availability
    * Available in iPhone OS 3.0 and later.

    See Also
    * @property userLocationVisible

    Declared In
    MKMapView.h"
     

Share This Page