如何使用Swift在我的应用程序中刷新Google Map? [英] How to Refresh the Google Map in my application using Swift?

查看:106
本文介绍了如何使用Swift在我的应用程序中刷新Google Map?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个标签栏应用程序,其中一个选项卡(MapTab)由GoogleMap组成,另一个选项卡(ImageTab)中保存所有图像。现在,当图像被保存在ImageTab中时,它将以Marker的形式显示在MapTab上。

I have made a tab bar application, in which one tab(MapTab) consist of an GoogleMap and in another one(ImageTab) all the images are saved. now, when the image get saved in ImageTab it get displayed on a MapTab in the form of Marker.

现在我的问题是,当我从ImageTab中删除图像时,它会被删除,但是如何从MapTab中删除它,即GoogleMap。

Now my question is, when i delete the image from ImageTab it gets deleted but how to remove it from MapTab i.e. GoogleMap.

推荐答案

首先清除所有mapView以前的标记:

First clear the all the mapView's previous markers with:

mapView.clear()

然后刷新你的图像数组。现在再次为刷新的图像阵列绘制标记。

And then refresh your image array. Now again draw the markers for the refreshed array of images.

这篇关于如何使用Swift在我的应用程序中刷新Google Map?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆