-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b6ca43
commit 21dde12
Showing
2 changed files
with
12,301 additions
and
3,158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,65 @@ | ||
<!doctype html><html lang="en"> <head> | ||
<meta charset='utf-8'/> | ||
<title> | ||
Preview | ||
</title> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" /> | ||
<!--[if lte IE 8]> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" /> | ||
<![endif]--> | ||
<style> | ||
html { height: 100% } | ||
body { height: 100%; margin: 0; padding: 0;} | ||
#map{ height: 100% } | ||
</style> | ||
<link rel="stylesheet" href="gh-pages.css" /> | ||
</head> | ||
<body><div class="github-fork-ribbon-wrapper right"> | ||
<div class="github-fork-ribbon"> | ||
<a href="https://github.com/calvinmetcalf/leaflet.shapefile">Fork me on GitHub</a> | ||
</div> | ||
</div> | ||
<div id="map"></div> | ||
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script> | ||
<script src="shp.js"></script> | ||
<script src="catiline.js"></script> | ||
<script src="leaflet.shpfile.js"></script> | ||
<script> | ||
var m = L.map('map').setView([ 42.09618442380296, -71.5045166015625],8); | ||
var watercolor = L.tileLayer('http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg',{attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(m); | ||
|
||
var shpfile = new L.Shapefile('congress.zip',{onEachFeature:function(feature, layer) { | ||
if (feature.properties) { | ||
layer.bindPopup(Object.keys(feature.properties).map(function(k){ | ||
return k + ": " + feature.properties[k] ; | ||
}).join("<br />"),{maxHeight:200}); | ||
} | ||
}}); | ||
shpfile.addTo(m); | ||
shpfile.once("load", function(){ | ||
console.log("finished loaded shapefile"); | ||
}); | ||
|
||
</script> | ||
</body> | ||
</html> | ||
|
||
|
||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset='utf-8' /> | ||
<title> | ||
Preview | ||
</title> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" /> | ||
<!--[if lte IE 8]> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" /> | ||
<![endif]--> | ||
<style> | ||
html { | ||
height: 100% | ||
} | ||
|
||
body { | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
#map { | ||
height: 100% | ||
} | ||
</style> | ||
<link rel="stylesheet" href="gh-pages.css" /> | ||
</head> | ||
|
||
<body> | ||
<div class="github-fork-ribbon-wrapper right"> | ||
<div class="github-fork-ribbon"> | ||
<a href="https://github.com/calvinmetcalf/leaflet.shapefile">Fork me on GitHub</a> | ||
</div> | ||
</div> | ||
<div id="map"></div> | ||
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script> | ||
<script src="catiline.js"></script> | ||
<script src="leaflet.shpfile.js"></script> | ||
<script> | ||
var m = L.map('map').setView([42.09618442380296, -71.5045166015625], 8); | ||
var watercolor = L.tileLayer('http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg', { | ||
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>' | ||
}).addTo(m); | ||
|
||
var shpfile = new L.Shapefile('congress.zip', { | ||
onEachFeature: function(feature, layer) { | ||
if (feature.properties) { | ||
layer.bindPopup(Object.keys(feature.properties).map(function(k) { | ||
return k + ": " + feature.properties[k]; | ||
}).join("<br />"), { | ||
maxHeight: 200 | ||
}); | ||
} | ||
} | ||
}); | ||
shpfile.addTo(m); | ||
shpfile.once("data:loaded", function() { | ||
console.log("finished loaded shapefile"); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.
21dde12
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.
Could you help me?
when i use this code, the button for import the shp is not here.