I am loading listing with map location markers but client wanted to have infowindow (popup)(dialog) for all to open bydefault.
I have followed this ticket but i can't see in code or documentation where i can reference all ? Any ideas or hints ?
https://toolset.com/de/forums/topic/maps-open-popup-on-start-load/
My site: hidden link
( function( $ ) {
$( document ).bind( 'js_event_wpv_addon_maps_init_map_completed', function(){
//var markerId = jQuery('.markerid').text();
var mapId = Object.keys(WPViews.view_addon_maps.maps)[0];
var map = WPViews.view_addon_maps.maps[mapId];
var mapsMarkers = WPViews.view_addon_maps.markers[Object.keys(WPViews.view_addon_maps.markers)];
Object.keys(mapsMarkers).forEach(function(key,index) {
var markerId = key;
var length = mapsMarkers[key];
console.log(key, mapsMarkers[key]);
var marker = WPViews.view_addon_maps.get_map_marker( key, [mapId] );
//var marker = mapsMarkers[Object.keys(mapsMarkers)[0]];
console.log(marker);
//alert(length);
WPViews.view_addon_maps.infowindows[ mapId ].setContent( $('div.js-wpv-addon-maps-marker-'+markerId).html());
WPViews.view_addon_maps.infowindows[mapId].open(map, marker);
});
//alert(length);
});
})( jQuery );
Hi,
Thank you for contacting us and I'd be happy to assist.
I've performed some tests on my website but I'm afraid, I couldn't make this work either. Apparently, the built-in code in the Toolset Maps plugin only allows the opening of one map marker info window, at a time. As soon as another info window opens, the previous one gets closed.
You're welcome to submit a feature request for this at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
For more personalized assistance around a custom code solution, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar
Okay, can your developers tell me a hook or line code where i could comment the code so that i can open multiple popups ? It will be a quick fix for me.
Thanks for writing back.
I've discussed it internally and in Toolset Maps, there is only one info window object per map. That same info window is repositioned and its content is updated each time, a different map marker is clicked.
For this reason, I'm afraid, it won't be possible to achieve this using custom code or commenting out some code from the core plugin files.
If it is an absolute requirement, then you'll have to replace the Toolset Maps with a fully custom developed map code, for example:
https://stackoverflow.com/a/11106794