Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Neshan Map 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>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Neshan Map Example (OpenLayers)</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="https://static.neshan.org/sdk/openlayers/5.3.0/ol.css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
@IBAction func togglePOILayer(_ sender: UISwitch) {
map.getLayers()?.insert(2, layer: NTNeshanServices.createPOILayer(mapStyle == .STANDARD_NIGHT))
}
// Initializing map
private void initMap(){
// add Standard_day map to layer BASE_MAP_INDEX
map.getOptions().setZoomRange(new Range(4.5f, 18f));
mapStyle = NeshanMapStyle.STANDARD_DAY;
map.getLayers().insert(BASE_MAP_INDEX, NeshanServices.createBaseMap(NeshanMapStyle.STANDARD_DAY));
// Setting map focal position to a fixed position and setting camera zoom
map.setFocalPointPosition(new LngLat(51.330743, 35.767234),0 );
map.setZoom(14,0);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Neshan Map POI 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>
@IBAction func toggleTrafficLayer(_ sender: UISwitch) {
map.getLayers()?.insert(1, layer: NTNeshanServices.createTrafficLayer())
}
// Initializing map
private void initMap(){
// add Standard_day map to layer BASE_MAP_INDEX
map.getOptions().setZoomRange(new Range(4.5f, 18f));
map.getLayers().insert(BASE_MAP_INDEX, NeshanServices.createBaseMap(NeshanMapStyle.STANDARD_DAY));
// Setting map focal position to a fixed position and setting camera zoom
map.setFocalPointPosition(new LngLat(51.330743, 35.767234),0 );
map.setZoom(14,0);
<!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>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Neshan Map 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.3.3/leaflet.css" rel="stylesheet" type="text/css">
<script src="https://static.neshan.org/sdk/leaflet/1.3.3/leaflet.js" type="text/javascript"></script>
</head>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Neshan Map Example (OpenLayers)</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="https://static.neshan.org/sdk/openlayers/4.6.5/ol.css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>