Generating multiple maps on multi record page
6 posts by 4 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: October 31, 2020 (RSS)
By 28sparks - October 20, 2020
Looking for a way to create separate maps for a listing page. Each record would have it's own map with clickable marker on it. I have the geocoder plugin, but the example code is for displaying one map on a single page or multiple pins on one map. If anyone has an example, it would be greatly appreciated.
By Dave - October 25, 2020
Hi 28sparks,
Can you explain a little more about what you're trying to do?
If each listing page displayed a map with the address for just that listing wouldn't that be a separate map for each listing?
Let me know some more details and we'll try to help. Thanks!
interactivetools.com
By 28sparks - October 26, 2020
Hi Dave. The plugin allows us to generate one map with multiple pins from a list or records. What I'm trying to load is individual maps for a list of records on a single page. Does that make sense?
By hans - October 28, 2020 - edited: October 28, 2020
Hello there! I will be the one helping you in this issue. Feel free to message if you have any questions afterwards!
The way the method was programmed, only one map was generated by the method. I modified it so that you can add as many maps as you want.
I have uploaded a replacement of the sample_map_single.php file below. Simply replace the file located at your plugins/geocoder_{version} folder named sample_map_single.php and view it in the Plugins.
jQuery_element_to_append_the_map_to = $("#maps_container");
map = initializeMap({latitude: latitude, longitude: longitude}, jQuery_element_to_append_the_map_to);
You will need jQuery for this.
The parameters are as follows:
function initializeMap( object properties = {} [, jQuery_element_to_append_to ]){}
under the first parameter properties, there is a required latitude and longitude property, where it contains a latitude, and longitude respectively. It will return a value of the map, and the map's properties.
PHP Programmer (In Training)
interactivetools.com
By Codee - October 31, 2020
Hey 28sparks, when you get it done live would you provide a link so we can view it in action?