Just upgrade from CGGoogleMaps (where I used sidebar) and I have no idea how to achieve this on CGGoogleMaps2.
I read on module help section "Users developing applications centered around a map can modify the map template of their map to quite easily add a sidebar." funny But how?
Any clues?
Best regards
[SOLVED] How to get markers list in CGGoogleMaps2
[SOLVED] How to get markers list in CGGoogleMaps2
Last edited by blast2007 on Fri Aug 29, 2014 6:20 am, edited 1 time in total.
Re: How to get markers list in CGGoogleMaps2
Now I got markers list with getMarkerList() but I don't know how to open infowindow for a single marker...
...anyone?
I can't understand if nobody use this module yet. Too new?
Thanks and regards
b.
...anyone?
I can't understand if nobody use this module yet. Too new?
Thanks and regards
b.
Re: How to get markers list in CGGoogleMaps2
---- up ----
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: How to get markers list in CGGoogleMaps2
use the showInfoWindow method.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: How to get markers list in CGGoogleMaps2
Thanks for your help but I'm really in trouble with all this CGclass* and its methods.
My map template is this:
Now I understand how to show markers list but I can't understand how to use showInfoWindow method on this list!
regards
My map template is this:
Code: Select all
...
<div id="underbar"></div>
{* javascript is on the bottom incase some smarty variables we need were set in the various generator calls *}
<__script__ type="text/javascript">
if( typeof(jQuery) == 'undefined' ) {
var div = document.getElementById('cggm_map_{$mapinstance}').
div.innerHTML = '<h3 style="color: red;">jQuery and jQuery UI Are Required</h3>';
throw new Error('jQuery and jQuery UI Are Required');
}
$(document).ready(function(){
var obj = $('#cggm_map_{$mapinstance}');
obj.cggm2({$generator->get_map_options_js()});
var myobj = obj.cggm2('getMarkerList');
for (var i = 0; i < myobj.length; ++i) {
$("#underbar").append( myobj[i].value + " - " + myobj[i].text + "<br />");
...
regards
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: How to get markers list in CGGoogleMaps2
It really isn't that hard.
a: build your sidebar, given the marker names
(each item should be a separate block, and inside that block you can have a link)
a structure something like <a class="showinfowindow" data-marker-name="some_place">Some Place</a>
b: add a jquery event handler function to trap a click on a sidebar item
- retrieve the marker name
- call obj.cggm2('showInfoWindow',the_marker_name');
a: build your sidebar, given the marker names
(each item should be a separate block, and inside that block you can have a link)
a structure something like <a class="showinfowindow" data-marker-name="some_place">Some Place</a>
b: add a jquery event handler function to trap a click on a sidebar item
- retrieve the marker name
- call obj.cggm2('showInfoWindow',the_marker_name');
Code: Select all
$('#sidebar a.showinfowindow').click(function(){
var the_marker_name = $(this).data('marker-name');
obj.cggm2('showInfoWindow',the_marker_name);
});
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: How to get markers list in CGGoogleMaps2
YEEEESSSSSS IT WORKSSS!!!
Thanks so much calguy1000!!!
Best regards
blast
Thanks so much calguy1000!!!
Best regards
blast