Problem:
The customer wants to add shapes to a map rendered by Toolset. They have geoCoordinates and wish to use the Google Maps addJSON feature but encounter difficulties because the map is already rendered by the time they can access it with JavaScript.
Solution:
I recommended using the js_event_wpv_addon_maps_init_map_completed event listener to run scripts when the map is rendered. An example was provided to adapt for adding a background color to a map area after rendering.
Upon trying the provided code, the customer encountered errors in the JS console and the shapes did not render as expected. Further investigation and temporary site access were requested to diagnose and resolve the issue. However, the customer was able to move forward with the original reference and resolved their issue.
Relevant Documentation:
https://developers.google.com/maps/documentation/javascript/examples/layer-data-polygon#maps_layer_data_polygon-javascript
https://developers.google.com/maps/documentation/javascript/datalayer
https://toolset.com/forums/topic/i-need-to-add-area-on-a-toolset-map/
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 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Sao_Paulo (GMT-03:00)
This topic contains 3 replies, has 2 voices.
Last updated by 5 months, 2 weeks ago.
Assisted by: Mateus Getulio.