-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.html
More file actions
115 lines (98 loc) · 3 KB
/
Copy pathsample.html
File metadata and controls
115 lines (98 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html ng-app="app" ng-controller="ctrl">
<head>
<meta charset="utf-8" />
<title>Neshan</title>
<link href="https://static.neshan.org/sdk/leaflet/1.4.0/leaflet.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<style>
body {
padding: 0;
margin: 0;
}
.neshan-container {
width: 100%;
height: 100vh;
}
.map-wrapper {
position: relative
}
.map-search {
position: absolute;
right: 5px;
top: 10px;
width: 500px;
z-index: 1000;
transition: all 0.5s;
}
.map-search.on {
height: 97%;
}
.map-search input {
background-color: #fff;
border: solid 2px #ccc;
direction: rtl;
font-weight: 300;
}
.search-result {
position: absolute;
right: 0;
top: 37px;
width: 100%;
z-index: 1000;
height: 100%;
overflow: auto;
direction: rtl;
font-weight: 300;
opacity: 5;
transition: all 0.5s;
}
.search-result:hover {
opacity: 1;
}
.search-result li {
cursor: pointer;
}
</style>
</head>
<body>
<neshan map-id="map"
watch-map-type="watchMapType"
output="map"
add-marker="[35.6997793747305, 51.337409038769465]"></neshan>
<script src="https://static.neshan.org/sdk/leaflet/1.4.0/leaflet.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.8/angular.js"></script>
<script src="neshan.min.js"></script>
<script>
var app = angular.module("app", ["Neshan"]);
app.config(function (neshanProvider) {
neshanProvider.configs({
mapKey: "web.**",
serviceKey: "service.**",
defaultCenter: [35.6997793747305, 51.337409038769465],
mapType: "neshan",
timeoutReady: 0,
zoomControl: false,
searchPlaceholderText: "search",
zoom: 16,
activeMarker: true,
singleMarker: true,
search: true,
poi: true,
traffic: true
});
});
app.controller("ctrl", function ($scope) {
$scope.map = {};
$scope.watchMapType = null;
var hour = (new Date()).getHours();
if (hour >= 19) {
$scope.watchMapType = "standard-night";
}
$scope.$watch("map", function (value) {
console.log(value);
}, true);
});
</script>
</body>
</html>