Display a venue map
//If you are using a base map, set the frames equal, otherwise, you can set it to any size you want
//Here, 'baseMap' refers to an instance of whichever map provider you are using,
//such as a GMSMapView or an MKMapView, etc
let frame = self.baseMap != nil ? self.baseMap!.frame : self.view.frame;
var vmMapView = VMVectorMapView(frame: frame, vmd: vmd)
vmMapView.venueId = "[VENUE_ID]";
//in the current version of the SDK, these values have to be specified independently
//but this will likely be simplified in a future version. The
vmMapView.tileBaseURL = "https://myserver.com/[VENUE_ID]/venue_map_[VENUE_ID]/vector-tiles";
vmMapView.vectorCommonBaseURL = "https://myserver.com/[VENUE_ID]/venue_map_[VENUE_ID]/vector-common";
vmMapView.minZoom = 16.0;
vmMapView.maxZoom = 22.0;
vmMapView.delegate = self;
vmMapView.style = self.venueStyle;
vmMapView.map = self.vmd;
//if you are using a base map, the 2nd parameter is used to insert the VMMapView above the base map
//in the view hierarchy
vmMapView.attachInView(self.view, self.vmd?.geolocated ?? false ? self.baseMap: nil)
After you’ve initiated the map view loading, register your VMMapViewDelegate
and wait for the didFinishLoadingVenueMapData
callback to be invoked.
public override func didFinishLoading(_ mapView: VMMapView)
{
//Do any additional customization of the map view
}
At this point, you should have a map display of the world with your map tiles superimposed.
Note: If you are using local assets that have been added to your application, be sure to refer to the appropriate subolder for the correct location of the tiles.