Hi, how do you set the zoom?... Do I use 75%?... I guess not!
The default map is zoomed in too much so I need it to zoom out.. some how!
Hi there,
the map object has a setZoom method, look it up in the GoogleMaps documentation...
A thing of beauty is a joy forever ( John Keats)
I needed to know the call in the snipet but I found out it was my ’ ’ marks that were wrong... All sorted now, for these that want to change the default zoom level use
Hi,
I would want to know how modify the snippet to make bubble marker closed by default.
I’ve tried this :
$gmapjs .= ’
map.addOverlay(marker);
//marker.openInfoWindowHtml(myMarkerContent); <- modification here
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(myMarkerContent);
});
}
createMarker(new GPoint(’.$coord[0].’,’.$coord[1].’));
}
}
The bubble marker is now closed when you load the google map but the map is not centered any more on my marker ...
Any idea ?
Thanks
There’s a little glitch if you are including the bubble content from a chunk, and it includes html with attributes or line breaks, since these interfere with the quoting of the javascript.
Replace
if (strlen($bubbletpl)) {
$gmapjs .= 'var myMarkerContent = "'.$modx->getChunk($bubbletpl).'";';
}
with
if (strlen($bubbletpl)) {
$js_safe_chunk= str_replace("\n", "", $modx->getChunk($bubbletpl));
$js_safe_chunk= str_replace("\r", "", $js_safe_chunk);
$js_safe_chunk= addslashes($js_safe_chunk);
$gmapjs .= 'var myMarkerContent = "'.$js_safe_chunk.'";';
}
(this could be neatened slightly, but it is split over 3 lines to make it read more easily.
Author:
ManagerManager plugin - customise your ModX manager interface
Rckt - web development, Sheffield, UK
Using &address parameter, a lot of maps created have markers, in a wrong street and sometimes in a wrong town or state
searching the same address on the google map site, works fine.