CGGoogleMaps: how to add extra value with cggm_add_dynpoint?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Quintijn
Forum Members
Forum Members
Posts: 17
Joined: Mon Oct 15, 2012 7:23 pm

CGGoogleMaps: how to add extra value with cggm_add_dynpoint?

Post 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});
Post Reply

Return to “Modules/Add-Ons”