Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

displaying geojson tiles from a remote server #2120

Closed
divya1c opened this issue Feb 14, 2016 · 4 comments
Closed

displaying geojson tiles from a remote server #2120

divya1c opened this issue Feb 14, 2016 · 4 comments

Comments

@divya1c
Copy link

divya1c commented Feb 14, 2016

Hi!

I am trying to display geojson tiles, that I get from my tilestache server, using mapboxgl.

I got it working in the case of pbf tiles, but wasn't able to find how I can request geojson tiles from my remote server. This is the script i use to add my geojson source, and it gives me an error that the property "tiles" is not valid.

var style = {
"version": 8,
"sources" : {
"terrain-data" : {
"type" : "geojson",
"tiles": ['http://127.0.0.1:8080/damage_blocks/{z}/{x}/{y}.json'],
"maxzoom": 10
}
},
"layers" : [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "#41afa5"
}
}, {
'id': 'terrain-data-layer',
'type': 'fill',
'source': 'terrain-data',
'source-layer': 'damage_blocks',
'paint': {
'fill-color': '#ff69b4',
'fill-opacity': 0.8
}
}]
};

var map = new mapboxgl.Map({
container: 'map',
//style: 'mapbox://styles/mapbox/streets-v8',
style : style,
zoom: 10,
center: [-122.447303, 37.753574]
});

@divya1c divya1c changed the title displaying geojson tiles displaying geojson tiles from a remote server Feb 14, 2016
@jfirebaugh
Copy link
Contributor

Tiled GeoJSON isn't supported. If you want to use tiled data, you need to provide it in vector tile format.

@peckjon
Copy link
Contributor

peckjon commented Mar 9, 2016

Any chance this will be supported in the future?

Tilestache MVT generation is MUCH more processor intensive than GeoJSON generation under certain conditions... to the point where it is pegging our server and failing. That's a separate problem, of course, but tiled GeoJSON in MapboxGL would be a welcome workaround.

@areichman
Copy link

I'm looking to do the same thing. We are transitioning a Leaflet app to GL and were previously using a variation of this plugin:

https://github.com/glenrobertson/leaflet-tilelayer-geojson

@jfirebaugh Is there a raw tile layer in GL that we could extend to build a similar plugin? The thought would be to fetch the GeoJSON for the various tiles and then assemble them using a single GeoJSON source. I'm just not sure how to get the tile locations in GL to be able to fetch the data.

@jfirebaugh
Copy link
Contributor

There's work underway to support extensible source types which could support this use case. See #2667, #2920, #3051.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants