Last active
February 5, 2019 15:44
-
-
Save ahmadazimi/8eeac038bf95e92fb52fc972c2367b75 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Neshan Map Traffic Layer Example (Leaflet)</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<link href="https://static.neshan.org/sdk/leaflet/1.4.0/leaflet.css" rel="stylesheet" type="text/css"> | |
<script src="https://static.neshan.org/sdk/leaflet/1.4.0/leaflet.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="map" style="width: 600px; height: 450px; background: #eee; border: 2px solid #aaa;"></div> | |
<script type="text/javascript"> | |
var myMap = new L.Map('map', { | |
key: 'YOUR_API_KEY', | |
maptype: 'dreamy', | |
center: [35.699739, 51.338097], | |
zoom: 14, | |
traffic: true, | |
onTrafficLayerSwitched: function (state) { | |
console.log(state); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment