Skip Navigation

[Resolved] Map with static image

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2610755

Hi, would it be possible to use Toolset Map with a static image?
The idea would be to create an interactive map of an entertainment area, storing the various locations info on WP posts and assigning them with markers on the map.

Any idea or suggestion is appreciated. Thanks.

#2610973

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

You can use the location from the Toolset Types Address field and show it on the map using Google's static maps API. But, that map would load as an image and won't be interactive.

Here are some helpful resources on the topic:
https://toolset.com/2022/10/how-toolset-and-the-maps-static-api-can-help-you-cut-costs/
https://toolset.com/forums/topic/without-openstreet-maps-how-can-we-make-google-maps-cheaper/

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2610983

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

You can use the location from the Toolset Types Address field and show it on the map using Google's static maps API. But, that map would load as an image and won't be interactive.

Here are some helpful resources on the topic:
https://toolset.com/2022/10/how-toolset-and-the-maps-static-api-can-help-you-cut-costs/
https://toolset.com/forums/topic/without-openstreet-maps-how-can-we-make-google-maps-cheaper/

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2611007

Hi, thanks for the tip. I'm aware of the topic you mentioned, and although I was already familiar with it, I understand that it still sends a request to Google, resulting in additional costs.

Once the addresses of the different markers have been defined, would it be possible to utilize a static image instead? By using a "default" coordinate, the markers could be positioned based on the relative positioning of the Toolset custom field address. Does this idea make sense to you?

#2611259

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

When a new address is saved in any address type custom field, its lat/lon coordinates are automatically saved in a Toolset custom map cache table. This way Google's Geocoding API calls are significantly reduced, as they're not called each time from the API and are loaded from that local table.

Despite that, whenever you'll load an interactive Google Map on a page, that map generation/rendering will still be charged.

> Once the addresses of the different markers have been defined, would it be possible to utilize a static image instead?

- To achieve something like this, you'll need a fair amount of complex code customization. You'll need a custom function that would:

a). Run each time a post with the address field is saved or updated.
b). Make a call to Google's static maps API and store the generated map image with the marker in the media library.
c). Also store that saved image's URL in an image type custom field.

This way, whenever you'll show the map with a specific location's map marker, you'll simply be loading the stored image from the media library and not making a call to Google's Maps API.

I hope this makes sense and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.