-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from watergis/feature/add-cdn
added CDN
- Loading branch information
Showing
10 changed files
with
6,875 additions
and
416 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
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,5 +1,6 @@ | ||
dist | ||
docs/bundle*.js | ||
docs/mapbox-gl-legend.* | ||
|
||
# Logs | ||
logs | ||
|
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
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
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,63 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Example</title> | ||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /> | ||
<link href='https://api.mapbox.com/mapbox-gl-js/v1.13.1/mapbox-gl.css' rel='stylesheet' /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" /> | ||
<link href='./mapbox-gl-legend.css' rel='stylesheet' /> | ||
<style> | ||
body { margin: 0; padding: 0; } | ||
#map { position: absolute; top: 0; bottom: 0; width: 100%;z-index: 10;} | ||
</style> | ||
</head> | ||
<body> | ||
<a class="github-fork-ribbon left-top" href="https://github.com/watergis/mapbox-gl-legend" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a> | ||
<div id="map"></div> | ||
<script src='https://api.mapbox.com/mapbox-gl-js/v1.13.1/mapbox-gl.js'></script> | ||
<script src="./mapbox-gl-legend.js"></script> | ||
<script> | ||
const map = new mapboxgl.Map({ | ||
container: 'map', | ||
style:'https://narwassco.github.io/mapbox-stylefiles/unvt/style.json', | ||
center: [35.87063, -1.08551], | ||
zoom: 12, | ||
hash:true, | ||
}); | ||
map.addControl(new mapboxgl.NavigationControl(), 'top-right'); | ||
map.on('load', function() { | ||
const targets = { | ||
'pipeline': 'Pipeline', | ||
'pipeline_annotation': 'Pipeline Label', | ||
'meter': 'Water Meter', | ||
'flow meter': 'Flow Meter', | ||
'valve': 'Valve', | ||
'firehydrant': 'Fire Hydrant', | ||
'washout': 'Washout', | ||
'tank': 'Tank', | ||
'tank_annotation': 'Tank Label', | ||
'wtp': 'WTP', | ||
'wtp_annotation': 'WTP Label', | ||
'intake': 'Intake', | ||
'intake_annotation': 'Intake Label', | ||
'parcels': 'Parcels', | ||
'parcels_annotation': 'Parcels Label', | ||
'village': 'Village', | ||
'village_annotation': 'Village Label', | ||
'dma': 'DMA', | ||
'dma-annotation': 'DMA Label', | ||
'contour-line': 'Countour', | ||
'contour-label': 'Contour Label', | ||
'hillshade': 'Hillshade' | ||
}; | ||
map.addControl(new watergis.MapboxLegendControl(targets, { | ||
showDefault: false, | ||
showCheckbox: false, | ||
onlyRendered: true, | ||
reverseOrder: true | ||
}), 'top-right'); | ||
}) | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.