-
Notifications
You must be signed in to change notification settings - Fork 28
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
Showing
10 changed files
with
166 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/examples export-ignore | ||
.jshintrc export-ignore | ||
.gitattributes export-ignore | ||
_config.yml export-ignore |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/examples | ||
.jshintrc | ||
.gitattributes | ||
_config.yml |
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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>leaflet-kmz</title> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<!-- Leaflet (JS/CSS) --> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css"> | ||
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"></script> | ||
|
||
<!-- JSZIP --> | ||
<!-- <script src="https://unpkg.com/jszip@3.1.5/dist/jszip.min.js"></script> --> | ||
|
||
<!-- @tmcw/togeojson --> | ||
<!-- <script src="https://unpkg.com/@tmcw/togeojson@3.0.1/dist/togeojsons.min.js"></script> --> | ||
|
||
<!-- geojson-vt --> | ||
<!-- <script src="https://unpkg.com/geojson-vt@3.0.0/geojson-vt.js"></script> --> | ||
|
||
<!-- Leaflet-KMZ --> | ||
<script src="https://unpkg.com/leaflet-kmz@0.3.0/dist/leaflet-kmz.js"></script> | ||
|
||
<style> | ||
html, | ||
body, | ||
.map { | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="map" class="map"></div> | ||
|
||
<script> | ||
var map = L.map('map'); | ||
map.setView(new L.LatLng(43.5978, 12.7059), 5); | ||
|
||
var OpenTopoMap = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', { | ||
maxZoom: 17, | ||
attribution: 'Map data: © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)', | ||
opacity: 0.90 | ||
}); | ||
OpenTopoMap.addTo(map); | ||
|
||
// Instantiate KMZ parser (async) | ||
var kmzParser = new L.KMZParser({ | ||
onKMZLoaded: function(layer, name) { | ||
control.addOverlay(layer, name); | ||
layer.addTo(map); | ||
} | ||
}); | ||
// Add remote KMZ files as layers (NB if they are 3rd-party servers, they MUST have CORS enabled) | ||
kmzParser.load('regions.kmz'); | ||
kmzParser.load('capitals.kmz'); | ||
kmzParser.load('globe.kmz'); | ||
kmzParser.load('multigeometry.kmz'); | ||
|
||
var control = L.control.layers(null, null, { collapsed:false }).addTo(map); | ||
</script> | ||
|
||
<a href="https://github.com/Raruto/leaflet-kmz" class="view-on-github" style="position: fixed;top: 10px;left: calc(50% - 60px);z-index: 9999;" > <img alt="View on Github" src="https://raruto.github.io/img/view-on-github.png" title="View on Github" width="163"> </a> | ||
|
||
</body> | ||
|
||
</html> |
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>leaflet-kmz</title> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<!-- Leaflet (JS/CSS) --> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css"> | ||
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"></script> | ||
|
||
<!-- Leaflet-Pointable --> | ||
<script src="https://unpkg.com/leaflet-pointable@0.0.3/leaflet-pointable.js"></script> | ||
|
||
<!-- JSZIP --> | ||
<!-- <script src="https://unpkg.com/jszip@3.1.5/dist/jszip.min.js"></script> --> | ||
|
||
<!-- @tmcw/togeojson --> | ||
<!-- <script src="https://unpkg.com/@tmcw/togeojson@3.0.1/dist/togeojsons.min.js"></script> --> | ||
|
||
<!-- geojson-vt --> | ||
<!-- <script src="https://unpkg.com/geojson-vt@3.0.0/geojson-vt.js"></script> --> | ||
|
||
<!-- Leaflet-KMZ --> | ||
<script src="https://unpkg.com/leaflet-kmz@0.3.0/dist/leaflet-kmz.js"></script> | ||
|
||
<style> | ||
html, | ||
body, | ||
.map { | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="map" class="map"></div> | ||
|
||
<script> | ||
var map = L.map('map'); | ||
map.setView(new L.LatLng(43.5978, 12.7059), 5); | ||
|
||
var OpenTopoMap = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', { | ||
maxZoom: 17, | ||
attribution: 'Map data: © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)', | ||
opacity: 0.90 | ||
}); | ||
OpenTopoMap.addTo(map); | ||
|
||
// Instantiate KMZ parser (async) | ||
var kmzParser = new L.KMZParser({ | ||
onKMZLoaded: function(layer, name) { | ||
control.addOverlay(layer, name); | ||
layer.addTo(map); | ||
}, | ||
interactive: false, // Disable default "leaflet.js" mouse layer interactions. | ||
pointable: true, // Enable optimized "geojson-vt.js" mouse layer interactions. | ||
}); | ||
|
||
// Here you can also override global KMZParser options | ||
kmzParser.load('regions.kmz'); | ||
kmzParser.load('capitals.kmz', { interactive: true }); | ||
kmzParser.load('globe.kmz', { ballon: false }); | ||
kmzParser.load('multigeometry.kmz', { pointable: false }); | ||
|
||
var control = L.control.layers(null, null, { collapsed: false }).addTo(map); | ||
</script> | ||
|
||
<a href="https://github.com/Raruto/leaflet-kmz" class="view-on-github" style="position: fixed;top: 10px;left: calc(50% - 60px);z-index: 9999;"> <img alt="View on Github" src="https://raruto.github.io/img/view-on-github.png" title="View on Github" | ||
width="163"> </a> | ||
|
||
</body> | ||
|
||
</html> |
Binary file not shown.
Binary file not shown.
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