Skip to content

Simple file upload demo#37

Open
ahalota wants to merge 3 commits intocalvinmetcalf:gh-pagesfrom
ahalota:gh-pages
Open

Simple file upload demo#37
ahalota wants to merge 3 commits intocalvinmetcalf:gh-pagesfrom
ahalota:gh-pages

Conversation

@ahalota
Copy link
Copy Markdown

@ahalota ahalota commented May 18, 2016

No description provided.

Comment thread file_upload_demo.html Outdated
<input type="submit" id="submit"> <span id="warning"></span>

<script>
map = L.map('map', {
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread file_upload_demo.html Outdated
}

function convertToLayer(buffer){
shp(buffer).then(function(geojson){ //More info: https://github.com/calvinmetcalf/shapefile-js
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

yup thats all L.shapefile does

On Wed, May 18, 2016 at 2:55 PM Anika S Halota notifications@github.com
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