mapbox

mapbox gl change icon color

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 01:23:31
问题 Is there a way to change a mapbox-gl-js icon-image color? This code taken from https://www.mapbox.com/mapbox-gl-js/example/geojson-markers/ won't change the marker color to red map.addLayer({ "id": "markers", "type": "symbol", "source": "markers", "layout": { "icon-image": "{marker-symbol}-15", "text-field": "{title}", "text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"], "text-offset": [0, 0.6], "text-anchor": "top" }, "paint": { "text-size": 12, "icon-color" : "#ff0000" } }); I've

Print Mapbox/Leaflet Map

爱⌒轻易说出口 提交于 2019-12-09 22:48:17
问题 I want to print a Mapbox Map, that has custom Pins on it. On Chrome or Safari, there is no problem, because I can just use the window.print command. The problems I have with Firefox and IE when trying to print: Pins show up in the wrong position Pins completely disappear What I also tried: Html2Canvas: That did not work, I guess because the tiles have fixed layouts. The canvas you get back only shows the typical grey/white grid "behind" the map Static MapBox API: I need the pins numbered

Mapbox GL js available icons

爷,独闯天下 提交于 2019-12-09 09:41:23
问题 I am rewriting a web application from Mapbox.js to Mapbox GL js. Using the standard 'mapbox://styles/mapbox/streets-v8' style, where can I find a list of all working marker icons? Here is my code: m.map.addSource("markers", { "type": "geojson", "data": { "type": "FeatureCollection", "features": { "type": "Feature", "geometry": { "type": "Point", "coordinates": ["-75.532965", "35.248018"] }, "properties": { "title": "Start", "marker-symbol": "entrance", "marker-size": "small", "marker-color":

Mapbox GL using external maps

只谈情不闲聊 提交于 2019-12-09 05:50:53
问题 I want to use Mapbox GL in my Android application. This service is going to be released soon and I have a tricky question about using the renderer. I like the renderer itself, but I really want to use my own maps data in the application (not the data, offered by Mapbox and which is paid). For instance, I want to parse OpenStreetMaps data on my own, customise it somehow and then put inside of a renderer to show it in my application. And now the question: is it possible to use my own maps data

proper implementation of invalidateSize() to display mapbox/leaflet on mobile device

心不动则不痛 提交于 2019-12-09 03:38:28
I started a question about a bootstrap leaflet map not displaying on mobile devices How can I fix bootstrap leaflet map mobile display? Since then I have used a simple mapbox template for a map and with invalidateSize() as outlined here https://www.mapbox.com/help/why-map-cropped-hidden-shown/ But still no luck getting the map to display on a mobile phone. Can anyone assist me with the proper implementation of invalidateSize()? Thanks Barry There is a single div element: <div id='map' class='blue'></div> and this is the script: <script> L.mapbox.accessToken = 'mytoken'; var map = L.map('map')

iOS Parse GeoPoints & MapBox Shapes

≡放荡痞女 提交于 2019-12-08 12:17:41
问题 So i am wondering how to go about retrieving Parse coordinates and drawing a shape using MapBox. I can retrieve the coordinates and plot them individually (using PARSE) on a map fine: PFQuery *locationQuery = [PFQuery queryWithClassName:@"Location"]; [locationQuery whereKeyExists:@"location"]; locationQuery.cachePolicy = kPFCachePolicyNetworkElseCache; [locationQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { // The find succeeded. NSLog(@

How to change margins in SMCalloutView

风格不统一 提交于 2019-12-08 12:08:49
问题 I'm using Mapbox SDK and SMCalloutView callout.view.frame = CGRectMake(0, 0, 300, 115); SMCalloutView *smcallout = [[SMCalloutView alloc] init]; smcallout.contentView = callout.view; [smcallout presentCalloutFromRect:smcallout.frame inLayer:annotation.layer constrainedToLayer:map.layer animated:YES]; How can i change margins from contentView to borders of calloutView? 回答1: You have to overwrite the SMCalloutView as I did here: https://github.com/Olinguito/YoIntervengoiOS/blob/master/Pods

Dynamically change the radius of circle-based extrusion with Mapbox

早过忘川 提交于 2019-12-08 11:54:06
问题 I want to dynamically adjust the radius of circle-based extrusions with Mapbox based on the zoom level. I have used for a toy dataset the solution provided by @stdob-- here and for which the JS Fiddle is available here. The problem with that solution is that it is computationally very expensive and with my real dataset (more than a million point) this is not a viable solution. I therefore thought about using queryRenderedFeatures() as suggested in the comments of the previous SO posts.

How can I get the distance, direction, duration from my current location to next step?

独自空忆成欢 提交于 2019-12-08 11:33:38
问题 I'm using Mapbox Android SDK compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0@aar') . I asked the similar question before at here, but still have some problem. I don't know how to implement when I get currentRoute. my code is as below: private Waypoint lastCorrectWayPoint; private boolean checkOffRoute(Waypoint target) { boolean isOffRoute = false; if(currentRoute != null){ if (currentRoute.isOffRoute(target)) { showMessage("You are off-route, recalculating..."); isOffRoute = true;

How can I show the count of points in the particular latitude and longitude in Mapboxgl?

旧时模样 提交于 2019-12-08 10:20:00
问题 I want to show the marker as well as the number of points available in a particular latitude and longitude. I expect something Similar as above. But i have added another 2 layers to show different color and number on it. If I do this way, I am getting "undefined" error while showing popup. Since the data takes from the other layer. If it takes from layer "locations" it works as expected. But when we have multiple occurences popup content shows "undefined". Below is my implementation output