Uma Madhavi Uma Madhavi - 1 month ago 5x
Swift Question

Google Map in tableView

I am facing an issue while displaying google maps in a table view cell with swift. I want to display check In (Latitude and Longitude) based on this I want to display google map in table view. I will latitude and longitude from server if no location available means I will get null. so, In one scenario I am getting correct, but while reloading the top-level I am getting map when and where their latitude and longitude is null also. Please guide me.


A map view is an expensive view to instantiate. Even when using dequeueReusableCellWithIdentifier it will still be resource-heavy with a large number of items.

I believe using a way to generate a static map image from your longitude/latitude combination is your best bet.

You can take a look here and you can see how to easily construct an API call to many popular map providers such as Google for a static image map like for example:,-73.998672&zoom=13&scale=false&size=600x300&maptype=roadmap&format=png&visual_refresh=true

Also worth mentioning that some of those providers might have limitations (Like Google might need an API key in case of high traffic). So choose wisely after some research.