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

Implementation guide. #58

Closed
ConorCoakley opened this issue Feb 16, 2016 · 1 comment
Closed

Implementation guide. #58

ConorCoakley opened this issue Feb 16, 2016 · 1 comment
Labels

Comments

@ConorCoakley
Copy link

I'm wondering is there any example implementation guide for geobuf? Anything that could guide someone like me (who's totally lost as to how to use it). Ideally some type of leaflet/mapbox related implementation spec would be great.

I understand you need to first encode your geojson file.
Then include your geobuf browser build in your leaflet file.

For leaflet, I get that you can convert the encoded file to geojson in the browser like so:

var layer = L.geoJson( geobuf.decode( new Pbf(data) ) ).addTo(map);

However, I'm totally lost as to how to bring my pbf file into leaflet. How do I bring it in? Can I just include it in a similar way to how I would have for a normal geojson layer, i.e:

script src="json_County201602090.pbf"></script

And 'data' would be a variable inside my pbf file?

Can someone shed some light on how to properly use geobuf?

Apologies if my issue isn't that sophisticated. I'd really appreciate some kind of guide.

Thanks.

@mourner
Copy link
Member

mourner commented Feb 17, 2016

You can learn how to load binary data in a browser here https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data

@mourner mourner closed this as completed Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants