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

how to display geojson polygons #15

Open
mikima opened this issue Apr 26, 2018 · 6 comments
Open

how to display geojson polygons #15

mikima opened this issue Apr 26, 2018 · 6 comments

Comments

@mikima
Copy link

mikima commented Apr 26, 2018

I'm trying to load a geoJson containing several features (polygons and multi polygons) with data attached.

I't not clear to me, however, how to display them using mappa.

the API documentation explains how to load them but not how to display them.

Also, i have issue loading the geojson itself. When I try to laod polygons i get this error:

Uncaught (in promise) TypeError: Cannot read property 'type' of null

at i (mappa.js:463)

at mappa.js:482

at Array.forEach (<anonymous>)

at e.default (mappa.js:481)

at o.value (mappa.js:271)

Could you provide a simple example?

thanks

@cvalenzuela
Copy link
Owner

Here is an example of how to load a geoJSON file:

https://github.com/cvalenzuela/Mappa/tree/707158f19fee84195455b46f71057848b3f24c2a#complete-example-4

It was on a previous version, I removed it and then forgot to add it to the new website.
Happy to work on a PR if you want to add it back again

@mikima
Copy link
Author

mikima commented Apr 26, 2018

Thanks!

@mikima
Copy link
Author

mikima commented May 2, 2018

Tried to play with it a little bit. But I don't understand what the advantage is in using myMap.geoJSON instead of just cycling through the JSON file itself. Is there something i'm missing?

@cvalenzuela
Copy link
Owner

It's a super simple wrapper around geoJSON file, just for the convenience of skipping some parts of the original file

@mikima
Copy link
Author

mikima commented May 3, 2018

i see. it's a pity yo loose access to the linked data. would be nice to have buil-in functions that directly create graphic items.

@cvalenzuela
Copy link
Owner

open to contributions! happy to help add this functionality

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

2 participants