更改设备方向时,谷歌地图的标记(覆盖)消失
我正在使用以下代码来显示当前位置的标记...但是当我更改设备标记的方向时消失..?
List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable = Activity.this.getResources().getDrawable(R.drawable.icon);
MyItemizedOverlay itemizedOverlay = new MyItemizedOverlay(drawable ,Activity.this);
GeoPoint point = new GeoPoint( (int)(location.getLatitude()*1000000),
(int)(location.getLongitude()*1000000));
OverlayItem overlayitem = new OverlayItem(point, "Current Location :","+acTextView.getText());
itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);
MapController mapController = mapView.getController();
mapController.animateTo(point);
mapController.setZoom(14);
如何处理地图视图中的方向..?
I am using the following code for showing the marker in the current location...but when i change the orientation of the device marker disappears..?
List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable = Activity.this.getResources().getDrawable(R.drawable.icon);
MyItemizedOverlay itemizedOverlay = new MyItemizedOverlay(drawable ,Activity.this);
GeoPoint point = new GeoPoint( (int)(location.getLatitude()*1000000),
(int)(location.getLongitude()*1000000));
OverlayItem overlayitem = new OverlayItem(point, "Current Location :","+acTextView.getText());
itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);
MapController mapController = mapView.getController();
mapController.animateTo(point);
mapController.setZoom(14);
How to handle the orientation in the mapview..?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,当设备的方向改变时,Activity 会重新启动。我将以下属性放入我的 manifest.xml 中,我的问题现在解决了:
Actually, when orientation of device changes the Activity restart..I put the following attribute in my manifest.xml and my problem is solved now :