GNOME Bugzilla – Bug 757143
Support for MultiPoint in GeoJSON
Last modified: 2015-12-02 09:38:28 UTC
Right now we do not handle the MultiPoint feature of GeoJSON: http://geojson.org/geojson-spec.html It should be straight forward to add this as just looping through coords and create placeMarkers, in geoJSONSource.js
You might have to create a geojson file by hand to get examples. Or try to create one with http://geojson.io
Created attachment 316477 [details] [review] Add support for MultiPoint in GeoJSON
Created attachment 316478 [details] [review] Add support for MultiPoint in GeoJSON
Created attachment 316479 [details] [review] Add support for MultiPoint in GeoJSON
I used this geojson for testing. https://gist.github.com/Alafazam/94d69b42a3844e7fd8b2 And it correctly creates placeMarkers. I think it should also Zoom in to corresponding boundingBox.
Review of attachment 316479 [details] [review]: Thanks! This looks really nice, just some nits below that I will fixup while pushing. Thanks for the example geoJSON as well! If you want to do more geoJSON stuff I would love to have some attention to this bug: https://bugzilla.gnome.org/show_bug.cgi?id=757144 ::: src/geoJSONSource.js @@ +120,3 @@ }, + _parsePoint: function(coordinates,properties) { Missing a space here: coordinates, properties @@ +169,2 @@ case 'Point': + this._parsePoint(geometry.coordinates,properties); Here as well. @@ +173,3 @@ case 'MultiPoint': + geometry.coordinates.forEach((function(coordinate,properties) { + this._parsePoint(coordinate,properties); And here
Oh, Sorry next time i.ll be more careful. Thanks. I think Map should also zoom into bounding box of place geoJson layer.
Np! But I think we already do that, right? The parsePoint function extends the bbox of the geoJSON layer and the mapView function that shows the layer zooms to the bbox.
Or you mean that instead of extending the bbox we could do: this._bbox = this._markerLayer.get_bounding_box(); ?
yes exactly.
But we can have geojson files that include points/multipoints as well as other features, so we can not rely on the markerLayer's bounding box exclusively.