mapbox

How to integrate Mapbox SDK with SwiftUI

ぃ、小莉子 提交于 2021-02-10 05:36:26
问题 I installed the Mapbox SDK into my project, but I don't understand how to integrate this code snippet with SwiftUI . I created a SwiftUI View named MapView , where I import the Mapbox Framework. I try to use the UIViewRepresentable protocol, as in Apple's tutorial, but without success. import Mapbox class MapView: UIViewController { override func viewDidLoad() { super.viewDidLoad() let styleURL = URL(string: "mapbox://styles/mapbox/outdoors-v9") let mapView = MGLMapView(frame: view.bounds,

Multicolor polylines for a route in mapbox

末鹿安然 提交于 2021-02-09 10:49:28
问题 i record routes with my app, mostly for motorbikes, and want to color it depending on the speed at each point of the route. basically i know how to do it in mapbox and that is the problem. since you can set a color for only one polyline, i have to split up the route in speed sections and print every route sections polyline with it's specific color, which works fine basically. problem is that i have up to 500-2000 polylines for a route. so the map crashes very easily. i don't have that problem

Multiple markers - Same coordinates

China☆狼群 提交于 2021-02-06 12:56:10
问题 I'm having some troubles trying to display 2 different markers placed at exactly the same coordinates. The case is: we are displaying stores, and some of them are placed at the same building (ie. a mall), so, they are different stores but shares the same ubication/coordinates. Our json source content looks like this: { "properties" : { "id" : "1", "name" : "Store 1" }, "geometry" : { "coordinates" : [-70.66667, -33.45], "type" : "Point" } }, { "properties" : { "id" : "2", "name" : "Store 2" }

Multiple markers - Same coordinates

本秂侑毒 提交于 2021-02-06 12:55:03
问题 I'm having some troubles trying to display 2 different markers placed at exactly the same coordinates. The case is: we are displaying stores, and some of them are placed at the same building (ie. a mall), so, they are different stores but shares the same ubication/coordinates. Our json source content looks like this: { "properties" : { "id" : "1", "name" : "Store 1" }, "geometry" : { "coordinates" : [-70.66667, -33.45], "type" : "Point" } }, { "properties" : { "id" : "2", "name" : "Store 2" }

Centering text label in mapbox-gl-js?

匆匆过客 提交于 2021-02-04 12:24:06
问题 I'm trying to center a text label over a feature polygon in mapbox-gl-js. Is this possible? It looks like the only option related to the placement of a label is the "symbol-placement" layout property (https://www.mapbox.com/mapbox-gl-style-spec/#symbol): symbol-placement Optional enum. One of point, line. Defaults to point. Label placement relative to its geometry. line can only be used on LineStrings and Polygons. Using "point" places the label at the bottom right corner of the feature:

MapBox: Capture whole screen but mapboxmap turned out to be black

心已入冬 提交于 2021-01-29 20:18:03
问题 I am implementing a running tracker. My UI consists of a MapBox mapView and a display that contains a few layouts that make up the time, distance etc. The mapView takes up the top half of the parent layout while the display takes up the bottom half. After the run I want to take a screenshot of the screen and save the img as a Bitmap. However when I use the conventional way of getDrawingCache() , the part of the img that is the mapView becomes a black box. Anyone knows how to solve this

MGLSymbolStyleLayer text not showing

天涯浪子 提交于 2021-01-29 12:56:23
问题 I successfully added an MGLSymbolStyleLayer layer to my map and configured its look by data from GeoJSON that's loaded locally, but I'm unable to set the value for text property. This is how I'm trying to do it inside mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) method: customLayer.text = NSExpression(forKeyPath: "{name}") When I run the app, the text is never shown while the image is loaded correctly. This is how my GeoJSON is formated. { "type":"FeatureCollection",

QT QML - Changing Mapbox font size

血红的双手。 提交于 2021-01-29 09:52:23
问题 I'm using QT 5.12.4 with the MapboxGl plugin and I'm trying to figure out how to make the street names display in a larger font but I'm very confused about how to specify a text size. I need to change the size dynamically so using a predefined style is not going to meet the requirements. The two confusing aspects are that Mapbox's documentation has to be translated into "MapParameters" for QML and I'm clueless as to what exactly is needed to change the text size. Between reading through the

MapBox markers stopped showing in the map after using dynamic data because the data comes late

一世执手 提交于 2021-01-29 08:26:48
问题 i have implemented a mapbox and it works so fine with static markers data , but when i used dynamic data that comes from retrofit 2 , the markers are not showing anymore , here an example of the result of query test on postman: [ { "cyclist_id": 1, "title": "Bike Cyclist 1", "latitude": 35.785118, "longitude": 10.000871 }, { "cyclist_id": 2, "title": "Bike Cyclist 2", "latitude": 36.9001, "longitude": 10.90175 }, { "cyclist_id": 3, "title": "Bike Cyclist 3", "latitude": 35.900893, "longitude"

How to add tile layer to map using mapboxgl.js

倖福魔咒の 提交于 2021-01-29 06:38:19
问题 Here m adding tile created using tiff mapboxgl.accessToken ='pk.eyJ1IjoiZ2F1cmF2Y2F0c3RlY2giLCJhIjoiY2l1cGo0MTl4MDAxajJ1bng5a2xieTY0diJ9.0fDXNulI91U85ngSc4jGCg'; var map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/light-v9', zoom: 13, center: [-122.447303, 37.753574] }); map.on('load', function () { map.addSource('terrain-data', { type: 'raster', url:'mapbox://gaurav.2on6cgzq' }); map.addLayer({ "id": "terrain-data", "type": "line", "source": "terrain-data", "source