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

Simple file upload demo #37

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open

Conversation

ahalota
Copy link

@ahalota ahalota commented May 18, 2016

No description provided.

<input type="submit" id="submit"> <span id="warning"></span>

<script>
map = L.map('map', {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var map

Limited input to .zip.
@ahalota
Copy link
Author

ahalota commented May 18, 2016

I made the changes you suggested in the file. I'm not too good with github so forgive me if I'm messing up the process a bit.

}

function convertToLayer(buffer){
shp(buffer).then(function(geojson){ //More info: https://github.com/calvinmetcalf/shapefile-js
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should either do

shp(buffer).then(function(geojson){ 
    var layer = L.geojson(geojson).addTo(map);
});

or

var layer = L.shapefile(buffer).addTo(map);

Simplified converToLayer functionl.
@ahalota
Copy link
Author

ahalota commented May 18, 2016

So, is the shp.js class already converting shapefile into geojson then? What does L.shapefile do? Is it just a simpler version that does both steps at once (shapefile->geojson->layer)?

@calvinmetcalf
Copy link
Owner

yup thats all L.shapefile does

On Wed, May 18, 2016 at 2:55 PM Anika S Halota [email protected]
wrote:

So, is the shp.js class already converting shapefile into geojson then?
What does L.shapefile do? Is it just a simpler version that does both steps
at once (shapefile->geojson->layer)?


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#37 (comment)

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

Successfully merging this pull request may close these issues.

2 participants