22
votes
Accepted
Rasterio: Use case for src.meta vs. src.profile when reading and writing rasters?
The meta property contains the basic raster metadata:
driver, dtype, nodata, width, height, count, crs, transform
The profile property is a super set of meta which includes dataset creation options:
...
20
votes
Accepted
Seeking tool for creating Vector MBTiles
POSTGIS now supports outputting vector tiles as endpoint to a Query. https://postgis.net/docs/ST_AsMVT.html I honestly don't recommend this approach because currently that's just geometry and no ...
15
votes
Is Leaflet Framework free?
Leaflet is free ($) and open, with a minimal requirement of keeping the license should you redistribute it.
Leaflet is a library that lets you display - and more - data. It is not a data provider.
...
15
votes
Accepted
Mapbox map with no style, only self hosted vector data
To remove the basemap from the example shown in your question
(https://docs.mapbox.com/mapbox-gl-js/example/hover-styles/), just replace
style: 'mapbox://styles/mapbox/streets-v11'
with
style: {...
14
votes
Accepted
How to add CSS styling in Mapbox GL Popup?
I've read this and several posts on SE, which pointed me in the right direction
Your link is pointing to the docs about mapbox.js which is different from mapbox-gl.js.
Docs for Mapbox GL JS: https://...
13
votes
Accepted
Mapbox GL JS - "Source Loaded" event
You can use below line of code
map.on('idle',function(){
//your code here
})
Once all the rendering part has been done then the above function will be called and then you can perform other ...
12
votes
How to test if a layer exist in a MapBox GL JS map?
From:
https://github.com/mapbox/mapbox-gl-js/issues/4466#issuecomment-288177042
To safely remove a layer that may or may not exist, guard the call to
removeLayer with getLayer:
// Always remove the ...
12
votes
Mapbox SDK: Is it free if you host your own vector tiles?
I have a similar problem. I want use openmaptiles + mapbox-gl-js for free without licence key. The licenceconditionen on mapbox page is not very clear. So I asked mapbox directly.
I asked:
I want ...
12
votes
How to test if a layer exist in a MapBox GL JS map?
Better way:
var mapLayer = map.getLayer('route');
if(typeof mapLayer !== 'undefined') {
// Remove map layer & source.
map.removeLayer('route').removeSource('route');
}
12
votes
How to add CSS styling in Mapbox GL Popup?
Mapbox GL JS:
If you need even more control over the styling of the popup (e.g. set background color for different types of popups), you can set a custom classname directly on the top level of the ...
11
votes
Accepted
Style line-width proportionally to maintain relative size in Mapbox GL
You've got the basic principle right, at each integer zoom level increase the line width would need to double to cover the same geographic area on the map (see zoom levels on the OSM wiki).
...
11
votes
How to filter layer features by value?
The "Filter symbols by toggling a list" example toggles the visibility of whole layers. For more fine grained filtering use map.setFilter, see https://www.mapbox.com/mapbox-gl-js/api/#map#setfilter.
...
11
votes
How do I increase the font size of contents in Map in Leaflet.js?
If you look at a single tile, the native resolution is 512x512, whereas the default tileSize in the tileLayer API is 256
Try setting the tileSize and zoomOffset:
L.tileLayer('https://api.mapbox.com/...
11
votes
Accepted
Moving marker cursor on two maps Mapbox
Add this style (change url):
.marker {
background-image: url('cursor.png');
background-size: cover;
width: 16px;
height: 16px;
cursor: pointer;
}
cursor.png ->
Add this script ...
10
votes
Mapbox GL JS - "Source Loaded" event
I was dealing with this again today, so here's an update!
As of mapbox-gl v0.44.2, it's still not quite reliable enough to listen for the sourcedata event and check the properties of the event ...
10
votes
Accepted
Mapbox not updating from OSM
Mapbox no longer applies OpenStreetMap edits right away and won't guarantee any timeframe for edits to appear. I've heard that their system for applying changes is backlogged and has lost some changes....
9
votes
Accepted
How to find layer names within vector tiles, without TileJSON or the .mbtiles file?
If you're okay to write a NodeJS script you can use
const request = require('request');
const VectorTile = require('@mapbox/vector-tile').VectorTile;
const Pbf = require('pbf');
const zlib = require('...
8
votes
Measured grid in Mapbox
If MapBox uses EPSG:3857 any grid will become distorted as you move away from the equator.
If you want an undistorted lat/lon grid try using EPSG:4326 (Plate Carree) - technically the grid is still ...
7
votes
Add vector tile sources to QGIS
Vector tiles are now supported directly in QGIS 3.14+:
https://www.qgis.org/en/site/forusers/visualchangelog314/index.html
https://www.lutraconsulting.co.uk/crowdfunding/vectortile-qgis/
7
votes
Mapbox satellite failed to upload in QGIS
I'm pretty sure the TMS that the plugin is calling is broken, either the token was cancelled, ran out of request capacity, or blocked by MapBox.
Try using a different satellite image background, ...
7
votes
Accepted
MapBox Text Layer is adding multiple text instead of single centered text
If you're trying to label a polygon then you need to tell Mapbox GL JS exactly where you want that label to be for each polygon. You need to do that by creating your own point from the polygon and ...
7
votes
Accepted
Convert from 16 bit unsigned GeoTIFF to 8 bit for Mapbox with QGIS
It looks like there is a consensus on the cause and fix for your rasters. For the benefit of users in the future experiencing the same issue, it is likely that your export from ArcGIS (Copy Raster?) ...
7
votes
Accepted
Add a WMS singletile layer in Mapbox GL
You can find below the same code as in the comment to make only single WMS calls (useful to avoid repeated labels). I've made some refactoring. You should also be aware that you need to consume a WMS ...
6
votes
Importing Maki Icons to QGIS
With QGIS 3 (and 2), the Maki icons can conveniently be imported using the Resource Sharing plugin. It is available in the QGIS plugin repository, so it is very easy to install it using the QGIS ...
6
votes
Mapbox GL JS - "Source Loaded" event
The solution is to use the undocumented style.load event that fires when new things finish loading into the style.
map.once('style.load', (ev) => {
// ...
});
6
votes
QGIS exports slightly inaccurate GeoJSON coordinates
ogre.adc4gis.com uses a GDAL utility to do the conversion from shapefile to GeoJSON. QGIS also uses GDAL, which would explain similar results.
The GDAL GeoJSON driver can give two types of GeoJSON, ...
6
votes
Accepted
Using ST_AsMVT with ST_TileEnvelope clipping in mapbox
Your geometries go beyond the range of validity for your projection, so those tiles are failing to render. You need to clip them before you transform (or alternately, clip your tile envelopes before ...
6
votes
Accepted
Map chopped off across 180degree line from QGIS to Mapbox
By the GeoJSON specification geometries which are crossing the dateline are not strictly forbidden but it is recommended that they are cut in two halves.
https://www.rfc-editor.org/rfc/rfc7946
In ...
5
votes
Using Mapbox tiles with folium
The answer above is correct, but I wanted to add some detail of where Mapbox users can get the necessary url for the code. When in Mapbox Styles page, simply choose to share your style, and under '...
5
votes
What's the most appropriate way to load Mapbox Studio tiles in Leaflet?
Geografa's answer is referring to tiles made with "Mapbox Studio Classic" (which was originally named "Mapbox Studio"). These "Classic" styles are found on your Mapbox account at https://www.mapbox....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mapbox × 870leaflet × 168
mapbox-gl-js × 158
javascript × 120
geojson × 88
vector-tiles × 86
mapbox-gl × 84
tilemill × 61
mapbox-studio × 60
openstreetmap × 55
qgis × 44
mbtiles × 42
tiles × 34
cartocss × 33
postgis × 26
web-mapping × 25
carto × 21
geoserver × 20
style × 19
markers × 19
raster × 18
layers × 18
geocoding × 15
mapnik × 15
python × 14