百度地图开发 画路径
来源:互联网 发布:50 seo 编辑:程序博客网 时间:2024/05/01 11:52
//轨迹坐标 private int geoPoint[][] = {{118099893, 24444963}, {118099888, 24444757}, {118099830, 24444400}, {118099722, 24443947}, {118099641, 24443437}, {118099502, 24443022}, {118099489, 24443014}, {118099085, 24442393}, {118098797, 24441986}, {118098680, 24441797}, {118099444, 24441320}, {118100989, 24440411}, {118101995, 24439667}, {118104016, 24439222}, {118105453, 24439190}, {118106882, 24439103}, {118108836, 24438758}, {118109837, 24438314}, {118112191, 24437536}, {118112191, 24437536}, {118113992, 24436895}, {118116143, 24435986}, {118117706, 24435620}, {118119512, 24435242}, {118120931, 24434970}, {118120945, 24435044}, {118121044, 24435916}, {118121286, 24437857}, {118121502, 24438680}, {118122023, 24439420}, {118122427, 24439740}, {118123913, 24440649}, {118122705, 24441928},};
/** * 轨迹回放 */ private void drawLine() { mViewBtn.mMapView.getController().setZoom(17); graphicsOverlay = new GraphicsOverlay(mViewBtn.mMapView); mViewBtn.mMapView.getOverlays().add(graphicsOverlay); GeoPoint pt1, pt2, pt3 = null; for (int i = 0; i < 32; i = i + 2) { if (i != 0) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } int lon = geoPoint[i][0]; int lat = geoPoint[i][1]; pt1 = new GeoPoint(lat, lon); if (i == 0) {//标记起点 setMarker(pt1,2); } lon = geoPoint[i + 1][0]; lat = geoPoint[i + 1][1]; pt2 = new GeoPoint(lat, lon); lon = geoPoint[i + 2][0]; lat = geoPoint[i + 2][1]; pt3 = new GeoPoint(lat, lon); //构建线 Geometry lineGeometry = new Geometry(); //设定折线点坐标 GeoPoint[] linePoints = new GeoPoint[3]; linePoints[0] = pt1; linePoints[1] = pt2; linePoints[2] = pt3; lineGeometry.setPolyLine(linePoints); //设定样式 Symbol lineSymbol = new Symbol(); Symbol.Color lineColor = lineSymbol.new Color(); lineColor.red = 0; lineColor.green = 0; lineColor.blue = 255; lineColor.alpha = 126; lineSymbol.setLineSymbol(lineColor, 10); //生成Graphic对象 Graphic lineGraphic = new Graphic(lineGeometry, lineSymbol); graphicsOverlay.setData(lineGraphic); mViewBtn.mMapView.refresh(); mViewBtn.mMapView.getController().animateTo(pt3); } setMarker(pt3,3);//标记终点 }
0 0
- 百度地图开发 画路径
- ios百度地图开发之路径规划
- 百度地图规划路径
- 百度地图 -- 离线地图开发
- 百度地图之路径规划
- 百度地图路径规划实例
- 百度地图之路径规划
- Android 百度地图路径规划
- 百度地图之路径规划
- 百度地图:建立百度地图开发环境)
- 开发百度地图
- 百度地图开发
- android 开发百度地图
- Android百度地图开发
- 百度地图开发总结
- 百度地图API开发
- IOS开发百度地图
- 百度地图开发1
- Android开发之动画(Animation)——Tween动画
- 类的数组和类的stl排序
- 2-SAT
- Android AudioPolicyService和AudioPolicyManager .
- Android 播放动态图片组件(随手记)
- 百度地图开发 画路径
- 【LeetCode】Binary Tree Preorder &Inorder & Postorder Traversal
- 杭电1063
- 动态规划算法
- 6道2-SAT题 (模板)
- Java归并排序
- Java基础从入门到精通
- 用C#模拟 Java Bean (二)—— SqlPojo
- TextView属性大全