mapbox-gl-js

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

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 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

Mapbox GL Popup .setDOMContent example

隐身守侯 提交于 2019-12-08 09:48:18
问题 I'm trying to create a customized button to appear on a pop up which generates a dynamic link (a URL). I don't seem to be able to do this via the .setHTML because of the timing, can't bind a button to a function at runtime. So I thought I'd try the newish .setDOMContent There's zero information online as to how this feature works. I'm wondering if anyone has an example of this where a button is added to the popup that can run a function and send data. Here's my very poor attempt at setting

Major issue overlaying GeoTIF in Mapbox GL JS

被刻印的时光 ゝ 提交于 2019-12-08 09:33:12
问题 I have some general questions to understand what has become a very serious issue in my project. I hope that I might come to some sort of understanding on what is happening here, as I am perplexed well over 2 months into this issue. Let me just dive in : I am in the process of making a weather app using Mapbox which displays both radar (rain) and satellite (visible clouds) over the state of Texas. I am using image overlays to accomplish this. The process is simple, but the overlays are not

Do embedded GeoJSON styles work with Mapbox GL?

旧城冷巷雨未停 提交于 2019-12-08 02:35:59
问题 Is it possible to utilize the built-in properties attribute of a GeoJSON data source to automatically style a Mapbox GL map without having to pre-specify a style? I have a use case where I dynamically load in GeoJSON LineString data that needs to be a particular color and it already has style data built in: {"properties": {"color": "#ffff33"... Right now, I have a rather inelegant setup where the relevant color is parsed out, translated into a style, and added to the map upon every load:

Missing MapBox CSS using React

南楼画角 提交于 2019-12-07 14:29:37
问题 I'm trying to work with MapBox using React. I've created the project with create-react-app, added mapbox-gl ("mapbox-gl": "^0.46.0-beta.1"), but I have a problem with css file. It shows me this warning: This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/ I've followed all steps: 1 - Install the npm package: npm install --save

Mapbox GL JS refresh layer

。_饼干妹妹 提交于 2019-12-06 16:26:51
I'm using Chroma.js to style a Mapbox choropleth map. I do this by storing in a variable dataStyleProp a single property of the source -- in this case the data are population and the properties are "free", "slave", "white", and "total"). Then I use dataStyleProp to build the Chroma.js color scale. What I would like to do is: Select the value for dataStyleProp from a radio button on the HTML page, Pass that value to the Chroma script, Then refresh the map to show the new choropleth. I've managed to do 1. and 2. but can't get 3. to work. I've tried map.update and map.resize to try to force the

how to customise cluster icon in mapbox-gl?

痴心易碎 提交于 2019-12-06 12:15:59
I want to implement clustering in my map. I found example of simple clustering from Mapbox Cluster Example but My code is here , where marker ==> {marker-symbol} is from studio. but it is not working. Is it possible to achieve output of cluster? Solved By following code var layers = [ [150], [20], [0] ]; layers.forEach(function(layer, i) { map.addLayer({ "id": "cluster-" + i, "source": "markers", "type": "symbol", "layout": { "text-field": "{point_count}", "text-font": [ "Arial Unicode MS Bold" ], "text-size": 13, "text-anchor": "bottom", "icon-image": "emptyMarker", "icon-size": 0.25 },

Mapbox GL 3D single building highlight selection

回眸只為那壹抹淺笑 提交于 2019-12-06 12:08:22
How can I highlight one single 3D building when hover over it? Something like the OSM buildings highlight feature. It seems the mapbox streets v7 building layer feature properties are so few, it only includes: extrude height min_height type underground There is no unique property to differentiate the building. Is there a way to include the address of the building or some unique ID? I do not think there is a unique per-building id in the Mapbox Streets v7 tileset. You may need to build your own tileset to get the desired behavior. 来源: https://stackoverflow.com/questions/40298274/mapbox-gl-3d