[2.x] MMMapView - MetamediaTechnology/longdo-map-demo-ios GitHub Wiki

@property(retain) id<MMMapViewDelegate> mapViewDelegate;

- (MMMapView *)initMapWithKey:(NSString *)accessKey;

Description

      Initializes a MMMapView object with Longdo Map API Key.

Parameters

  • accessKey Longdo Map API Key.

Return

      MMMapView object.


- (MMMapView *)initMap; // without key, you need your own map server  /** Close the map to release memory.

Description

      Initializes a MMMapView object "without" API Key.

Return

      MMMapView object.

Warning

      layer name from SDK will not work, you must use custom map server.


- (void)setMaxZoom:(int)zoom;

Description

      Set max zoom level for the map.

Parameters

  • zoom new map max zoom level [1-20].

- (void)setMinZoom:(int)zoom;

Description

      Set min zoom level for the map.

Parameters

  • zoom new map min zoom level [1-20].

- (void)setMapBackgroundColor:(UIColor *)color;

Description

      Set map background color of the mapin no tile area.

Parameters

  • color Color of map background.

- (void)enablePan:(bool)isEnable;

Description

      Enable or disable pan to move action on map

Parameters

  • isEnable enable or disable.

- (void)enablePinch:(bool)isEnable;

Description

      Enable or disable pinch to zoom action on map

Parameters

  • isEnable enable or disable.

- (void)enableTilt:(bool)isEnable;

Description

      Enable or disable tilt action on map

Parameters

  • isEnable enable or disable.

- (void)enableRotate:(bool)isEnable;

Description

      Enable or disable rotate action on map

Parameters

  • isEnable enable or disable.

- (void)enableCenterZooming:(bool)isEnable;

Description

      Enable or disable conter pinching zooming on map, if enable pinch zoom will keep map current center only zoom change.

Parameters

  • isEnable enable or disable.

- (void)enableCrossMark:(bool)isEnable;

Description

      Enable or disable center red mark at the center of the map

Parameters

  • isEnable enable or disable.

- (MMLocation)location;

Description

      Get map current location.

Return

      map current location.


- (void)setLocation:(MMLocation)location;

Description

      Set map current location without animation.

Parameters

  • location the new location of the map.

- (void)setLocation:(MMLocation)location withAnimation:(bool)isAnimate;

Description

      Set map current location with animation control.

Parameters

  • location the new location of the map.

  • isAnimate move map with animation or not.


- (int)zoom;

Description

      Get map current zoom.

Return

      map current zoom.


- (void)zoomIn;

Description

      Zoom in for one level with animation


- (void)zoomOut;

Description

      Zoom zoom for one level with animation


- (void)setZoom:(int)zoom; // Without animation  /** Set map zoom with animation control. @param zoom the new zoom of the map. @param isAnimate zoom map with animation or not.

Description

      Set map zoom without animation.

Parameters

  • zoom the new zoom of the map.

- (float)fineZoom;

Description

      Get map current zoom in fine scale.

Return

      map current fine zoom.


- (void)setFineZoom:(float)fineZoom;

Description

      Set map fine zoom without animation.

Parameters

  • fineZoom the new fine zoom of the map.

- (CGRect)locationBoundaryForZoom:(int)zoom atCenter:(MMLocation)location;

Description

      Get map boundary for zoom at a specific location.

Return

      regtangular of MMLocation


- (void)setMapBoundaryFor:(CGRect)boundary;

Description

      Set map boundary for a regtangular of MMLocation.

Parameters

  • boundary a regtangular of MMLocation

- (void)setBoundaryBetween:(MMLocation)location1 and:(MMLocation)location2 withExtraZoom:(int)extraZoom;

Description

      Set map boundary between location1 and location2.

Parameters

  • location1 location at top left.

  • location2 location at buttom right.

  • extraZoom set zoom more or less than the zoom.


- (void)setBoundaryBetween:(MMLocation)location1 and:(MMLocation)location2 withCenter:(MMLocation)center andExtraZoom:(int)extraZoom;

Description

      Set map boundary between location1 and location2, with fixed center.

Parameters

  • location1 location at top left.

  • location2 location at buttom right.

  • center location that will be set for the center of the map.

  • extraZoom set zoom more or less than computed zoom.


- (NSArray *)markers;

Description

      Get all markers that are showing on the map.

Return

      array of MMMarker *.


- (void)addMarker:(MMMarker *)marker;

Description

      Add a marker to the map.

Parameters

  • marker the marker to be added.

- (void)removeMarker:(MMMarker *)marker;

Description

      Remove a marker from the map.

Parameters

  • marker the marker to be removed.

- (void)removeMarkerByName:(NSString *)name;

Description

      Remove marker(s) by marker's name.

Parameters

  • name the name of marker(s) to be removed.

- (void)removeAllMarkers;

Description

      Remove all markers from the map.


- (void)showLongdoTags:(NSArray *)longdoTags;

Description

      Show longdo tags on the map.

Parameters

  • array of MMLongdoTag *.

- (void)hideLongdoTags;

Description

      Remove longdo tags from the map.


- (MMLayer *)layerName:(NSString *)name;

Description

      Get layer from Longdo Map server.

Parameters

  • name see LAYER_NAME_ constraints.

Return

      layer to use for the map.


- (MMLayer *)baseLayer;

Description

      Get current base layer.

Return

      current base layer.


- (NSArray *)overlayLayers;

Description

      Get current overlay layers.

Return

      array of current overlay layers, (MMLayer *).


- (void)setBaseLayer:(MMLayer *)layer;

Description

      Set base layer for map view.

Parameters

  • layer map layer to set as base layer.

- (void)addOverlayLayer:(MMLayer *)layer;

Description

      Add overlay layer to map view.

Parameters

  • layer overlay layer to be added.

- (void)removeOverlayLayer:(MMLayer *)layer;

Description

      Remove overlay layer from map view.

Parameters

  • layer overlay layer to be removed.

- (void)removeAllOverlayLayers;

Description

      Remove all overlay layers from map view.


- (MMScaleBar *)scaleBar;

Description

      Get map scale bar.

Return

      map scale bar object to process directly.


- (float)width;

Description

      Get current map view width.

Return

      view width.


- (float)height;

Description

      Get current map view height.

Return

      view height.


- (void)setDebugLabel:(UILabel *)label;

Description

      Display map debug on UILabel *.

Parameters

  • label to display map debug.