高德地图有两个key 一个web一个js 要用js的key
1:显示地图
- map = new AMap.Map('map', {
- resizeEnable: true,
- zoom: 14,
- center: [east, north]
- });
-
- map.plugin(["AMap.ToolBar"], function() {
- map.addControl(new AMap.ToolBar({
- offset: new AMap.Pixel(20, 45),
- position: "RT"
- }));
- });
RT: right top
2 显示标注
- marker = new AMap.Marker({
- map: map,
- position: [east, north],
- icon: new AMap.Icon({
- size: new AMap.Size(40, 50),
- image: imgurl,
- imageOffset: new AMap.Pixel(0, 0)
- })
- });
-
- markers.push(marker);
-
- AMap.event.addListener(marker, 'mouseover', function () {
-
- });
3 删除标注
4 逆向地址
//&plugin=AMap.Geocoder 必须在<script>加上
- var geocoder = new AMap.Geocoder({
- radius: 1000,
- extensions: "all"
- });
- geocoder.getAddress([obj.gdeast, obj.gdnorth], function (status, result) {
- <span style="white-space:pre"> </span>
- geocoder_CallBack_openInfo(result);
-
- });
5 轨迹回放 高德有自己的轨迹回放例子 贴个地址
http://lbs.amap.com/api/JavaScript-api/example/marker/replaying-historical-running-data/