Last active
September 6, 2017 09:48
-
-
Save yuskesuzki/1c8c754f7237f06cac99 to your computer and use it in GitHub Desktop.
Leaflet.js imageoverlay sample no1
This file contains hidden or 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
html,body{ | |
margin: 0px; | |
padding: 0px; | |
} | |
#map { | |
width: 100%; | |
height: 100%; | |
} | |
</style> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script> | |
var map = L.map('map', { | |
maxZoom: 24, | |
minZoom: 1, | |
crs: L.CRS.Simple | |
}).setView([0, 0], 1); | |
map.setMaxBounds(new L.LatLngBounds([0,345], [230,0])); //表示可能範囲 | |
var imageUrl = 'https://farm6.staticflickr.com/5495/9188725689_ac415ed0b5_h.jpg'; | |
var imageBounds = [[230,0], [0,345]]; //初期表示範囲 | |
L.imageOverlay(imageUrl, imageBounds, { | |
attribution:'' | |
}).addTo(map); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment