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

+ (MMMarker *)markerWithImage:(UIImage *)image andLocation:(MMLocation)location;

Description

      Create a new marker from UIImage.

Parameters

  • image the image to use with marker.

  • location the location to set marker on the map view.

Return

      marker a new marker.

Warning

      marker must be created on the main thread.


+ (MMMarker *)markerWithImageUrl:(NSString *)url andLocation:(MMLocation)location;

Description

      Create a new marker from a URL of image.

Parameters

  • url the URL of the image to use with marker.

  • location the location to set marker on the map view.

Return

      marker a new marker.

Warning

      marker must be created on the main thread, use this function may cause lag during marker download at the first time.


- (NSString *)name;

Description

      Get marker name.

Return

      marker name.


- (UIImage *)image;

Description

      Get marker image.

Return

      marker image.


- (MMLocation)location;

Description

      Get marker location.

Return

      marker location.


- (CGPoint)offset;

Description

      Get marker offset.

Return

      marker offset.


- (int)weight;

Description

      Get marker weight.

Return

      marker weight.


- (NSDictionary *)data;

Description

      Get marker data.

Return

      marker data.


- (int)minZoom;

Description

      Get marker min zoom.

Return

      marker min zoom.


- (int)maxZoom;

Description

      Get marker max zoom.

Return

      marker max zoom.


- (bool)isClickable;

Description

      Get is marker clickable.

Return

      is marker clickable.


- (bool)isPersistent;

Description

      Get is marker persistent. Persistent markers will not be removed via remove all markers function.

Return

      is marker persistent.


- (MMMarker *)setName:(NSString *)name;

Description

      Set marker name.

Parameters

  • name marker name.

- (MMMarker *)setImage:(UIImage *)image;

Description

      Set marker image.

Parameters

  • image marker image.

- (MMMarker *)setLocation:(MMLocation)location;

Description

      Set marker location.

Parameters

  • location marker location.

- (MMMarker *)setOffset:(CGPoint)offset;

Description

      Set marker offset. Marker offset scale in marker width and height ratio. (0.0f, 0.0f) is the center of the marker. x will shift marker to the right. y will shift marker down.

Parameters

  • location marker offset.

- (MMMarker *)setWeight:(int)weight;

Description

      Set marker weight.

Parameters

  • weight marker weight.

- (MMMarker *)setData:(NSDictionary *)data;

Description

      Set marker data. Developer can add a NSDictionary object to the marker to save some data.

Parameters

  • data marker data.

- (MMMarker *)setMinZoom:(int)minZoom;

Description

      Set marker min zoom. The marker will not show map current zoom is less than min zoom.

Parameters

  • minZoom marker min zoom.

- (MMMarker *)setMaxZoom:(int)maxZoom;

Description

      Set marker max zoom. The marker will not show map current zoom is more than min zoom.

Parameters

  • minZoom marker max zoom.

- (MMMarker *)setIsClickable:(bool)isClickable;

Description

      Set marker clickable. If marker is clickable, when user click, it will call delegate function clickOnMarker.

Parameters

  • isClickable is marker clickable.

- (MMMarker *)setIsPersistent:(bool)isPersistent;

Description

      Set marker persistent. If a marker is persistent, it will not be removed by removeAllMarkers.

Parameters

  • isPersistent is marker persistent.

- (MMMarker *)effectFadeIn:(bool)isEnable;

Description

      Set marker effect fade in. When marker is created, it will fade in from alpha 0.f.

Parameters

  • isEnable marker will fade in.

- (MMMarker *)effectFadeInWithDuration:(float)second;

Description

      Set marker fade in duration.

Parameters

  • second marker fade in duration.

- (MMMarker *)effectDrop:(bool)isEnable;

Description

      Set marker effect drop. When marker is created, it will drop from some top distance.

Parameters

  • isEnable marker will drop.

- (MMMarker *)effectDropDuration:(float)second;

Description

      Set marker drop duration.

Parameters

  • second marker drop duration.

- (MMMarker *)effectScaleUp:(bool)isEnable;

Description

      Set marker effect scale up. When marker is created, it will scale up from small size.

Parameters

  • isEnable marker will scale up.

- (MMMarker *)effectScaleUpDuration:(float)second;

Description

      Set marker scale up duration.

Parameters

  • second marker scale up duration.