ALL BUSINESS
COMIDA
DIRECTORIES
EDUCATIONAL
ENTERTAINMENT
FASHION TIPS
FINER THINGS
FREE CREATOR TOOLS
HEALTH
MARKETPLACE
MEMBER's ONLY
MONEY MATTER$
MOTIVATIONAL
NEWS & WEATHER
TECHNOLOGIA
TELEVISION NETWORKS
USA VOTES 2024
VIDEOS
INVESTOR RELATIONS
IN DEVELOPMENT
Posted by - Latinos MediaSyndication -
on - June 20, 2023 -
Filed in - Technology -
-
368 Views - 0 Comments - 0 Likes - 0 Reviews
I have read the documentation and frankly saying it didn't ring a bell for me. I have multiple annotation that needs to be shown on map view. The objective here is that we should plot the user location with a different custom annotation view and some services that are around him with another custom annotation view. I am using Mapbox version 10.13
Below is what I did for implementing at least 1 annotation.
var source = GeoJSONSource() source.data = .feature(Feature(geometry: .point(Point(LocationCoordinate2D(latitude: 8.549788, longitude: 76.899910))))) try! mapView.mapboxMap.style.addSource(source, id: "1") var layer = LocationIndicatorLayer(id: "1") let lat = 8.549788 let lon = 76.899910 layer.location = .constant([lat, lon]) let image = UIImage(named: "ic_search_flag")! layer.topImage = .constant(.name("ic_search_flag")) layer.source = "1" layer.sourceLayer = nil try? mapView.mapboxMap.style.addImage(UIImage(named: "ic_search_flag")!, id: "ic_search_flag", stretchX: [], stretchY: []) try? mapView.mapboxMap.style.addLayer(layer, layerPosition: .default)