Home >
Net > Ask bosses winfom call Scott map to give the coordinate error to HTML
Ask bosses winfom call Scott map to give the coordinate error to HTML
<script>
Var marker;
Var mapinit=new AMap. The Map (" container ", {
ResizeEnable: true,
Center: [116.397428, 39.90923],
Zoom: 17
});
The function drawzb (zblist)
{
- wanted to incoming zblist replaced the following lineArr, results submitted to the script errors direct call no problem
LineArr=[[116.478935, 39.997761], [116.478939, 39.997825], [116.478912, 39.998549], [116.478912, 39.998549], [116.478998, 39.998555], [116.478998, 39.998555], [116.479282, 39.99856], [116.479658, 39.998528], [116.480151, 39.998453], [116.480784, 39.998302], [116.480784, 39.998302], [116.481149, 39.998184], [116.481573, 39.997997], [116.481863, 39.997846], [116.482072, 39.997718], [116.482362, 39.997718], [116.483633, 39.998935], [116.48367, 39.998968], [116.484648, 39.999861]].
Var map=new AMap. The map (" container ", {
ResizeEnable: true,
Center: [116.397428, 39.90923],
Zoom: 17
});
Marker=new AMap. Marker ({
Map: the map,
Position: [116.478935, 39.997761],
Icon: "car. PNG,"
Offset: new AMap. Pixel (26, - 13),
AutoRotation: true,
Angle: - 90,
});
//draw the path
Var polyline=new AMap. Polyline ({
Map: the map,
Path: lineArr,
ShowDir: true,
StrokeColor: "# 28 f",//line color
//strokeOpacity: 1,//line transparency
StrokeWeight: 6,//line width
//strokeStyle: "solid"//line style
});
Var passedPolyline=new AMap. Polyline ({
Map: the map,
//path: lineArr,
StrokeColor: "# AF5",//line color
//strokeOpacity: 1,//line transparency
StrokeWeight: 6,//line width
//strokeStyle: "solid"//line style
});
Marker. On (' moving ', function (e) {
PassedPolyline. SetPath (e.p assedPath);
});
Map. SetFitView ();
}
//
The function startAnimation () {
Marker. MoveAlong (lineArr, 200);
}
The function pauseAnimation () {
Marker. PauseMove ();
}
The function resumeAnimation () {
Marker. ResumeMove ();
}
The function stopAnimation () {
Marker. StopMove ();
}
</script>