-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
circleSet_event.html
66 lines (56 loc) · 2.25 KB
/
circleSet_event.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
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Map:Circle geolocation Set:Event</title>
<style>html,body{height:100%;}body{padding:0;margin:0;}h1{padding:0;margin:0;font-size:50%;}</style>
</head>
<body>
<!-- MAP[START] -->
<h1>Map:Circle geolocation Set:Event</h1>
<div id="myMap" style='width:60%;height:70%;float:left;'></div>
<!-- MAP[END] -->
<script src='https://www.bing.com/api/maps/mapcontrol?callback=GetMap&key=[ *** YOUR MY KEY *** ]' async defer></script>
<script src="../js/BmapQuery.js"></script>
<script>
//****************************************************************************************
// BingMaps&BmapQuery
//****************************************************************************************
//Init
function GetMap(){
//------------------------------------------------------------------------
//1. Instance
//------------------------------------------------------------------------
const map = new Bmap("#myMap");
//------------------------------------------------------------------------
//2. Display Map
// startMap(lat, lon, "MapType", Zoom[1~20]);
// MapType:[load, aerial,canvasDark,canvasLight,birdseye,grayscale,streetside]
//--------------------------------------------------
map.startMap(47.6000, -122.1599, "load", 12);
//------------------------------------------------------------------------
//3.circle location Set: Event
// circleSet( lat, lon, Meter, style={pinColor,fillColor,strokeWidth} );
//------------------------------------------------------------------------
//Style
const style = {
pinColor:"#0000ff",
fillColor:"rgba(0,0,100,0.4)",
strokeWidth:1
};
//CircleSet:Event
map.circleSet(47.6200, -122.1100, 1500, style, "click", function(){
map.infobox(47.6200, -122.1100, "Title1", "Description1");
}); //1500=1.5Km
//CircleSet:Event
map.circleSet(47.5500, -122.1299, 2000, style, "click", function(){
map.infobox(47.5500, -122.1299, "Title2", "Description2");
}); //2000=2Km
//CircleSet:Event
map.circleSet(47.6149, -122.1941, 3000, style, "click", function(){
map.infobox(47.6149, -122.1941, "Title3", "Description3");
}); //3000=3Km
}
</script>
</body>
</html>