Page 1 of 1

CGGoogleMaps: how to add extra value with cggm_add_dynpoint?

Posted: Tue Jan 22, 2013 12:27 pm
by Quintijn
CMSMS 1.11.4
CGGoogleMaps 2.4.3


Problem: I like to add an URL to a marker, so I can link the marker to another page.

Question: How can I add an URL to cggm_add_dynpoint?

Stuck at the CGGM Javascript template of a map:

/ build the markers
jQuery('#cggm_map_defn_'+mapInstance+' div.cggm_map_markers > div.cggm_marker').each(function(){
// create the marker object.
var url = jQuery(":input[name='newurl']",this).val();
var name = jQuery(":input[name='name']",this).val();
var lat = jQuery(":input[name='latitude']",this).val();
var lon = jQuery(":input[name='longitude']",this).val();
var icon = jQuery(":input[name='icon']",this).val();
var title = jQuery(":input[name='title']",this).val();
var marker = new google.maps.Marker({
url: url,
map: mapObj,
title: title,
map_instance: mapInstance,
alias: name,
position: new google.maps.LatLng(lat,lon)
});
if( icons != undefined && icon != undefined ) {
marker.icon = icons[icon];
}
marker.jq = this;
// store the marker for later retrieval.
jQuery(this).data('marker',marker);
{/literal}
google.maps.event.addListener(marker, 'click', function() {ldelim}
window.location.href = marker.url;
{rdelim});