mapbox-gl-js

Converting GeoJSON to Vector Tiles on the fly w/ MapBox GL JS?

若如初见. 提交于 2021-02-19 04:19:21
问题 My map's source file is GeoJSON, but it is very large and very slow. Is there a way to convert this to vector tiles on the fly using MapBox GL JS? (Load the GeoJSON, pre-process the file into vector tiles, and show use the vector tiles as the base map.) It seems that vector tiles are much faster. I've tried all the GeoJSON-VT tutorials and examples that I could, like the one on MapBox's site, but it just says that GeoJSON-VT works under the hood, so it isn't much help. The others mostly apply

Converting GeoJSON to Vector Tiles on the fly w/ MapBox GL JS?

∥☆過路亽.° 提交于 2021-02-19 04:19:19
问题 My map's source file is GeoJSON, but it is very large and very slow. Is there a way to convert this to vector tiles on the fly using MapBox GL JS? (Load the GeoJSON, pre-process the file into vector tiles, and show use the vector tiles as the base map.) It seems that vector tiles are much faster. I've tried all the GeoJSON-VT tutorials and examples that I could, like the one on MapBox's site, but it just says that GeoJSON-VT works under the hood, so it isn't much help. The others mostly apply

Converting GeoJSON to Vector Tiles on the fly w/ MapBox GL JS?

时间秒杀一切 提交于 2021-02-19 04:18:38
问题 My map's source file is GeoJSON, but it is very large and very slow. Is there a way to convert this to vector tiles on the fly using MapBox GL JS? (Load the GeoJSON, pre-process the file into vector tiles, and show use the vector tiles as the base map.) It seems that vector tiles are much faster. I've tried all the GeoJSON-VT tutorials and examples that I could, like the one on MapBox's site, but it just says that GeoJSON-VT works under the hood, so it isn't much help. The others mostly apply

Converting GeoJSON to Vector Tiles on the fly w/ MapBox GL JS?

◇◆丶佛笑我妖孽 提交于 2021-02-19 04:16:19
问题 My map's source file is GeoJSON, but it is very large and very slow. Is there a way to convert this to vector tiles on the fly using MapBox GL JS? (Load the GeoJSON, pre-process the file into vector tiles, and show use the vector tiles as the base map.) It seems that vector tiles are much faster. I've tried all the GeoJSON-VT tutorials and examples that I could, like the one on MapBox's site, but it just says that GeoJSON-VT works under the hood, so it isn't much help. The others mostly apply

MaxBounds and custom asymmetric padding in Mapbox GL

北城以北 提交于 2021-02-11 17:52:51
问题 I have a Mapbox GL JS app, where over a map I display some widgets. To make sure nothing on the map will be hidden by them I've added some padding using map.setPadding() . It's an asymmetric one (left is larger than right in my case). It works as intended for things like fitBounds and animation but I also need to set up maxBounds of the map so the user won't pan out of the desired viewport. Unfortunately that doesn't work well with custom padding. When I draw the bounds and use showPadding I

URL for Mapbox style sheet JSON

倾然丶 夕夏残阳落幕 提交于 2021-02-11 14:28:17
问题 Is there a URL that serves up the style sheet JSON for a given style? All the URL's are in Mapbox scheme: mapbox://styles/wfisher/41dj33random72ravc31c5dyn But I'd like to download the JSON directly on load so I can modify it before passing in a Javascript object to <ReactMapGL> . 回答1: You have to use the Mapbox Static API: https://www.mapbox.com/api-documentation/#retrieve-a-style so the URL would be: https://api.mapbox.com/styles/v1/wfisher/41dj33random72ravc31c5dyn?access_token=<token> and

Change JavaScript variable value by passing new values inside URL ( GET request )

谁都会走 提交于 2021-02-10 15:16:41
问题 I have an i frame which has a src called map.php. <iframe src= "map.php " ></iframe> Inside map.php i have a variable called map. I want to change the value of "center " inside the map variable to something new when the src load up map.php (javascript) var map = new mapboxgl.Map({ center: [115.83333, -32.01667], }); So my question is whether i can pass some parameter values along with src = map.php to change the center value example. ( Just my concept ) <iframe src= "map.php/parameter center

Change JavaScript variable value by passing new values inside URL ( GET request )

早过忘川 提交于 2021-02-10 15:14:20
问题 I have an i frame which has a src called map.php. <iframe src= "map.php " ></iframe> Inside map.php i have a variable called map. I want to change the value of "center " inside the map variable to something new when the src load up map.php (javascript) var map = new mapboxgl.Map({ center: [115.83333, -32.01667], }); So my question is whether i can pass some parameter values along with src = map.php to change the center value example. ( Just my concept ) <iframe src= "map.php/parameter center

Varnish ban is added but old object is returned

可紊 提交于 2021-02-08 06:32:49
问题 I'm using varnish in front of a tile server to cache mapbox tiles. To remove old tiles, I intended to use bans to effectively remove a large number of cached tiles. My problem is that varnish still uses the cached objects (at least the age in the response indicates this) and doesn't contact the backend. I'm first requesting http://varnish/5/3/4.pbf, then adding a ban with curl -X BAN -H 'X-Purge-Regex: 5/3/4.pbf' varnish or alternatively varnishadm and then ban obj.http.url ~ 5/3/4.pbf and

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