Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (50 sloc) 1.97 KB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Map:Circle 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 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.6149, -122.1941, "load", 13);
//------------------------------------------------------------------------
//3.Circle Add: Event
// circle(int Meter, string Color ,string Color, int strokeWidth );
//------------------------------------------------------------------------
//Style Setting
const style = {
pinColor:"#0000ff",
fillColor:"rgba(0,0,100,0.4)",
strokeWidth:10
};
// Click:Event
map.circle(3000, style, "click", function(){
const lat = map.getCenter().latitude; //Get MapCenter Latitude
const lon = map.getCenter().longitude; //Get MapCenter Longitude
map.infobox(lat, lon, "Title", "Description");
}); //3000=3Km
}
</script>
</body>
</html>
You can’t perform that action at this time.