-
Notifications
You must be signed in to change notification settings - Fork 16
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
Integrate Support for GeoJSON #707
Conversation
Would it be possible to calculate the layer extent as we process the feature geometries? i.e., since we have to process each and every coordinate in the json, we could keep a running min / max and set that via a <map-meta> at the end of the process? It needn't be inserted in the <map-head> I believe it will be looked for whereever it occurs, which could be at the end of the document. Uncertain on this last point. Perhaps it would be expensive to re-write the whole document. |
Yes, I believe this can be done.
It should only calculate the layer's extent when json.bbox is not present (I already map the json.bbox to a map-meta) I presume? |
I think that's correct. |
This is working like a charm, thank you! Let's review together tomorrow. |
@@ -409,6 +423,24 @@ export class WebMap extends HTMLMapElement { | |||
{target: this}})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prushforth A lot of the other code in web-map.js is specific to mapml-viewer and most likely does not work on web-map. We will need to go over this in the future. Ex (go up for code):
document.activeElement.nodeName === "MAPML-VIEWER"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! definitely, put it on the backlog...
* Add mapml2geojson and geojson2mapml functions to M.Util * geojson versions for mapml-viewer and layer * Add support for pasting GeoJSON * Paste Layers using Ctrl+v * Add default extent when json.bbox not present * Add the ability to drag and drop layer-'s links and GeoJSON to the viewer * Add localized default layer name * Add ability to paste links using context menu and ctrl+v + Add more tests * Create function for paste (pasteLayer), instead of repeating code * make helper functions 'private' * add bbox extent when given a feature * Add test case for geojson feature (bbox/extent test)
copy/paste layers using GeoJSON through the context menu 295224fGeoJSON as application/geo+jsonCloses #706