地图视图,替换/删除地图图钉
这部分代码需要一些坐标并在地图中绘制一个标签图标。
private void drawMapLocations(Canvas canvas, MapView mapView) {
Iterator<MapTagLocation> iterator = mapTab.getMapLocations().iterator();
Point screenCoords = new Point();
while (iterator.hasNext()) {
MapTagLocation location = iterator.next();
mapView.getProjection().toPixels(location.getPoint(), screenCoords);
canvas.drawBitmap(tagIcon, screenCoords.x - tagIcon.getWidth() / 2, screenCoords.y - tagIcon.getHeight(), null);
}
}
现在我想创建一个方法来删除或替换地图中的特定标签。有什么办法吗?
* tagIcon 是位图。
This part of code takes some coordinates and draws a tag icon in the map.
private void drawMapLocations(Canvas canvas, MapView mapView) {
Iterator<MapTagLocation> iterator = mapTab.getMapLocations().iterator();
Point screenCoords = new Point();
while (iterator.hasNext()) {
MapTagLocation location = iterator.next();
mapView.getProjection().toPixels(location.getPoint(), screenCoords);
canvas.drawBitmap(tagIcon, screenCoords.x - tagIcon.getWidth() / 2, screenCoords.y - tagIcon.getHeight(), null);
}
}
Now I want to make a method that removes or replace a specific tag in the map. Is there any way?
*The tagIcon is a Bitmap.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论