Many occasions to use Baidu map, here is the author of his own home county of position (latitude and longitude) and location of residential home (latitude and longitude) marked out on Baidu map.
HTML `` `: RUN
<HTML>
<head>
<Meta HTTP-equiv =" the Type-the Content "Content =" text / HTML; charset = UTF-. 8 "/>
<Meta name =" the viewport "Content =" initial- = 1.0 Scale, Scalable = NO-User "/>
<title> gushi government </ title>
<style type =" text / CSS ">
body, HTML, # onlymap {width: 100%; height: 100%; margin: 0; font-family: " Microsoft yahei";}
</ style>
<Script type = "text / JavaScript" the src = "http://api.map.baidu.com/api?v=2.0&ak= vvNvGRSQV4QdtGZaoKDB04yW5mFBrFSX "> </ Script>
</ head>
<body>
<div ID =" onlymap "> <
new new BMap.Map the Map = var ( "onlymap");
map.centerAndZoom (new new BMap.Point (115.6608, 31.7575), 10);
map.enableScrollWheelZoom ();
// county where I => Gushi County, the county government position
var = new new BMap.Point countyGovernmentPoint (115.6608, 32.1749);
var = countyGovernmentmarker new new BMap.Marker (countyGovernmentPoint);
the Map.addOverlay (countyGovernmentmarker);
var countyGovernmentPosition countyGovernmentmarker.getPosition = ();
var = countyGovernmentPositionLng countyGovernmentPosition.lng;
var = countyGovernmentPosition countyGovernmentPositionLat .lat;
var = countyGovernmentLabel new new BMap.Label ( "county where I => Gushi county government positions: <br/> longitude" + countyGovernmentPositionLng + "degrees north latitude and" + countyGovernmentPositionLat + "degrees", {offset:new BMap.Size(-105,37)});
countyGovernmentmarker.setLabel (countyGovernmentLabel);
var = new new BMap.Circle Circle (countyGovernmentPoint, 500, {strokeColor is: "Red", strokeWeight:. 5, strokeOpacity: 0.5});
the Map.addOverlay (Circle);
// residential home I => position
var = myFamilypoint new new BMap.Point (115.7097, 31.9053);
var = myFamilymarker new new BMap.Marker (myFamilypoint);
the Map.addOverlay (myFamilymarker);
var myFamilyPosition myFamilymarker.getPosition = ();
var = myFamilyPositionLng myFamilyPosition.lng;
var myFamilyPositionLat myFamilyPosition.lat =;
var myFamilyLabel new new BMap.Label = ( "I = residential home> location: <br/> longitude" + myFamilyPositionLng + "degrees north latitude and" + myFamilyPositionLat + "degrees", {offset: new BMap.Size ( -75 , 28)});
myFamilymarker.setLabel (myFamilyLabel);
// add the upper left corner of the default image translation control
var topLeftNavigation new new BMap.NavigationControl = ();
Map.addControl (topLeftNavigation);
</ Script>
`` `
76 Baidu map: latitude and longitude
Guess you like
Origin www.cnblogs.com/gushixianqiancheng/p/10967063.html
Recommended
Ranking