-
Notifications
You must be signed in to change notification settings - Fork 0
/
gif
58 lines (48 loc) · 1.33 KB
/
gif
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
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css">
<style>
.map {
height: 400px;
width: 100%;
}
#marker {
width: 150px;
height: 150px;
background: url("http://netanimations.net/colorchangearrowdown.gif") no-repeat scroll 0% 0% transparent;
}
</style>
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
<title>OpenLayers example</title>
</head>
<body>
<h2>My Map</h2>
<div id="map" class="map"></div>
<div style="display: none;">
<div id="marker" title="Marker"></div>
<!-- Popup -->
</div>
<script type="text/javascript">
var baseMapLayer = new ol.layer.Tile({
source: new ol.source.OSM()
});
var map = new ol.Map({
target: 'map',
layers: [ baseMapLayer],
view: new ol.View({
center: ol.proj.fromLonLat([-9.567156,30.412447]),
zoom: 7 //Initial Zoom Level
})
});
var pos = ol.proj.fromLonLat([-9.482459,30.379512]);
var marker = new ol.Overlay({
position: pos,
positioning: 'center-center',
element: document.getElementById('marker'),
stopEvent: false
});
map.addOverlay(marker);
</script>
</body>
</html>