Skip to content

Instantly share code, notes, and snippets.

@ahmadazimi
Last active February 5, 2019 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmadazimi/8eeac038bf95e92fb52fc972c2367b75 to your computer and use it in GitHub Desktop.
Save ahmadazimi/8eeac038bf95e92fb52fc972c2367b75 to your computer and use it in GitHub Desktop.
<!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