mapbox-gl

Mapbox GL 3D single building highlight selection

纵然是瞬间 提交于 2019-12-10 11:05:35
问题 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? 回答1: I do not think there is a unique per-building id in the Mapbox Streets v7 tileset. You may need to build

Message from debugger: Terminated due to memory issue

China☆狼群 提交于 2019-12-10 01:52:43
问题 My app working with Geojson file. I use MapBox SDK to add MGLPolyline to map. But the problem is my file too large, so that the app crash and got the error: Message from debugger: Terminated due to memory issue . I faced with 66234 objects at first loop. I tried to chunk the array to new array but not success. Please help me to solve the prolem. Here is my code for draw on map and here is my test project on github use Xcode 8.1 If have any different 3rd party which can solve my prolems is

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

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

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

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

Double on click event with mapbox gl

妖精的绣舞 提交于 2019-12-06 08:00:52
I am redrawing layers on style.load event and removing the layers map.on('style.load', function() { loadByBounds(tempBounds) }); function loadByBounds(b) { if (map.getLayer("cluster-count")) { map.removeLayer("cluster-count"); } ... map.on('click', 'unclustered-point', function(e) { var popup = new mapboxgl.Popup() .setLngLat(e.features[0].geometry.coordinates) .setHTML(text) .addTo(map); })} But how to remove map.on('click') events? As when I click the point the Popup() displays 2 times. And when I change layer one more time the onclick event fires 3 times and so on. So I think I have to

Message from debugger: Terminated due to memory issue

旧街凉风 提交于 2019-12-05 00:20:08
My app working with Geojson file. I use MapBox SDK to add MGLPolyline to map. But the problem is my file too large, so that the app crash and got the error: Message from debugger: Terminated due to memory issue . I faced with 66234 objects at first loop. I tried to chunk the array to new array but not success. Please help me to solve the prolem. Here is my code for draw on map and here is my test project on github use Xcode 8.1 If have any different 3rd party which can solve my prolems is welcome too : func drawPolyline() { // Parsing GeoJSON can be CPU intensive, do it on a background thread