-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap-marker-click.html
57 lines (48 loc) · 2.12 KB
/
map-marker-click.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1">
<meta name=description content="OpenLayer - Set map marker on click and get position.">
<title>OpenLayer - Set marker</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- OpenLayers map -->
<!--
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/css/ol.css" type="text/css">
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/build/ol.js"></script>
-->
<script src="https://cdn.jsdelivr.net/npm/ol@v9.2.4/dist/ol.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol@v9.2.4/ol.css">
<!-- Map style -->
<link rel="stylesheet" href="ol-map.css">
<!-- Enable map parts -->
<script defer src="ol-map.js"></script>
<script defer src="ol-map-marker.js"></script>
<!-- Map events -->
<script defer src="ol-map-marker-click.js"></script>
<script defer src="ol-map-popup.js"></script>
<script defer src="ol-map-functions.js"></script>
<script defer src="ol-map-polygon-delivery-area.js"></script>
</head>
<body>
<h1>OpenLayer - Set marker geolocation</h1>
<p>Create new marker on double click. (Console: SHIFT + CTRL + K for errors)</p>
<form>
<!-- Address -->
<label>Country, city, address</label>
<input type="text" id="address">
<!-- Location -->
<label>Location lon, lat</label>
<input type="text" id="location">
<a onclick="getLatLngClick(this);" id="btn"> Search</a>
</form>
<!-- Map div -->
<div id="map" class="map"></div>
<!-- Map Popup div -->
<div id="ol-popup" class="ol-popup animated hop">
<a id="close"> <img src="img/close.png" width="15" height="15"> </a>
<div id="content"></div>
</div>
<script type="text/javascript">
</script>
</body>