Skip to content

[3.x] LongdoMapView

Kamonpop Jarujit edited this page Jun 23, 2021 · 17 revisions
@property (nonatomic, assign) id <LMSearchDelegate> searchDelegate;

Description

Use for get search callback from Longdo Map service.


@property (nonatomic, assign) id <LMTileDataDelegate> dataDelegate;

Description

Use for get JSON data callback from custom layer.


@property (nonatomic, assign) id <LMAQIDataDelegate> aqiDelegate;

Description

Use for get AQI data callback when tap AQI annotation.


@property (nonatomic, assign) LMLanguage language;

Description

Set language of the map and other features of framework.


@property (nonatomic, assign) CGFloat zoomLevel;

Description

Zoom level of map view.


@property (nonatomic, assign) LMUserAnnotationType userAnnotationType;

Description

An appearance of user location's annotation.


@property (nonatomic, strong) NSURL* boxDomain;

Description

URL Path of User's Longdo Box.


@property (nonatomic, strong) UIImageView* crosshair;

Description

Crosshair on center of Map.


@property (nonatomic, assign) LMUserAnnotationType userAnnotationType;

Description

An appearance of user location's annotation.


@property (nonatomic, strong) UIImage* userLocationImage;

Description

Custom user location image on map. (Best size at 32x40 px)


@property (nonatomic, strong) UIImage* userLocationArrow;

Description

Custom user location arrow on map. (Best canvas size at 70x70 px)


@property (nonatomic, assign) IBInspectable BOOL showsEvents;

Description

Flag to indicate whether the map shows traffic events.


@property (nonatomic, assign) IBInspectable BOOL showsCameras;

Description

Flag to indicate whether the map shows traffic cameras.


@property (nonatomic, assign) IBInspectable BOOL showsAQI;

Description

Flag to indicate whether the map shows air quality with AQICN data sources.


@property (nonatomic, assign) IBInspectable BOOL showsAir4Thai;

Description

Flag to indicate whether the map shows air quality with Air4Thai data sources.


- (void)setKey:(NSString *)key;

Description

      Initializes a LongdoMapView object with Longdo Map API Key.

Parameters

  • key Longdo Map API Key.

- (void)setCache:(LMCache)cached;

Description

      Enable cache for map.

Parameters

  • cached cached set how to cache.

- (MKCoordinateSpan)coordinateSpanWithZoomLevel:(CGFloat)zoomLevel;

Description

      Get map span with specific zoom.

Parameters

  • zoomLevel the zoom of the map.

Return

      Span of the map with specific zoom.


- (void)addLMLayer:(LMLayer *)layer;

Description

      Add overlay layer to map view.

Parameters

  • layer Overlay layer to be added.

- (void)addLMLayers:(NSArray<LMLayer *>*)layers;

Description

      Add multiple overlay layers to map view.

Parameters

  • layers Array of overlay layers to be added.

- (void)removeLMOverlay:(LMMode)overlayName;

Description

      Remove overlay layer from map view.

Parameters

  • overlayName overlay layer to be removed.

- (void)removeSourceLayer:(NSString *)sourceLayer;

Description

      Remove overlay layer from map view.

Parameters

  • sourceLayer Layer from source that need to be removed.

- (void)showTags:(NSArray *)tag;

Description

      Show longdo tags on the map.

Parameters

  • tag array of tag name.

- (void)removeAllTags;

Description

Remove longdo tags from the map.


- (BOOL)clearAllCaches;

Description

      Remove map tile caches from device.

Return

      Clear cache success.


- (NSString *)UTMFrom:(CLLocationCoordinate2D)coordinate withZone:(BOOL)hasZone;

Description

      Convert WGS 84 value to UTM value.

Parameters

  • coordinate value in WGS 84 format.
  • hasZone show UTM zone in return value.

Return

      Value in UTM format.


- (CLLocationCoordinate2D)coordinateFromUTM:(NSString *)utmString;

Description

      Convert UTM value to WGS 84 value.

Parameters

  • utmString value in UTM format.

Return

      Value in WGS 84 format.


- (double)areaOfPolygon:(MKPolygon *)polygon;

Description

      Get area size in metres from MKPolygon.

Parameters

  • polygon Polygon for calculate area size.

Return

      Size of polygon area.


- (void)updateCrosshair;

Description

Manually update crosshair to center of the map when map's frame changed.


- (UIView *)getVDOViewFromCameraData:(LMCameraAnnotation *)camera;

Description

Get vdo view from camera annotation data.


- (void)searchKeyword:(NSString *)keyword withOptions:(LMSearchOptions *)options result:(void (^)(NSArray<LMPinAnnotation *> *poi, NSError *err))result;

Description

      Search with Longdo Map POI.

Parameters

  • keyword An informative word for searching with Longdo.
  • options Options for searching with Longdo.
  • result A completion block to call when Point of Interest (POI) result is available.

- (void)suggestKeyword:(NSString *)keyword withOptions:(LMSuggestOptions *)options result:(void (^)(NSArray<NSString *> *keyword, NSError *err))result;

Description

      Suggest with Longdo Map POI.

Parameters

  • keyword An informative word for suggestion with Longdo.
  • options Options for suggestion with Longdo.
  • result A completion block to call when a suggested name for each POI is available.

- (void)routeFrom:(CLLocationCoordinate2D)start To:(CLLocationCoordinate2D)destination withOptions:(LMRouteOptions *)options result:(void (^)(LMRouteResult *route, NSError *err))result;

Description

      Route with Longdo Map.

Parameters

  • start A starting point for routing with Longdo.
  • destination A destination point for routing with Longdo.
  • options Options for routing with Longdo.
  • result A completion block to call when a routing result is available.

Clone this wiki locally