I have some custom icons working but seem to have made a mistake in
the code and no longer get a pop up window on the marker.
Im sure the issue is simple as my understanding of the API and Java
are both very limited.
if i add 'map.addOverlay(marker);' at the bottom i get the originial
markers appearing and these are 'clickable' ....can anyone help?
--------------------------------------------------------------------------------------------------------------------------------
code below
--------------------------------------------------------------------------------------------------------------------------------
if (GBrowserIsCompatible()) {
var railIcon = new GIcon(G_DEFAULT_ICON);
railIcon.image = "http://newmedia.leeds.ac.uk/ug07/cs07ra/rolluk2/
cs07ra/wwwroot/images/rail.png";
railIcon.iconSize = new GSize(35, 40);
railIcon.infoWindowAnchor = new GPoint(0, 0);
var parkIcon = new GIcon(G_DEFAULT_ICON);
parkIcon.image = "http://newmedia.leeds.ac.uk/ug07/cs07ra/rolluk2/
cs07ra/wwwroot/images/park.png";
parkIcon.iconSize = new GSize(35, 40);
parkIcon.infoWindowAnchor = new GPoint(0, 0);
var ledgeIcon = new GIcon(G_DEFAULT_ICON);
ledgeIcon.image = "http://newmedia.leeds.ac.uk/ug07/cs07ra/rolluk2/
cs07ra/wwwroot/images/ledge.png";
ledgeIcon.iconSize = new GSize(35, 40);
ledgeIcon.infoWindowAnchor = new GPoint(0, 0);
var otherIcon = new GIcon(G_DEFAULT_ICON);
otherIcon.image = "http://newmedia.leeds.ac.uk/ug07/cs07ra/rolluk2/
cs07ra/wwwroot/images/other.png";
otherIcon.iconSize = new GSize(35, 40);
otherIcon.infoWindowAnchor = new GPoint(0, 0);
var freeparkIcon = new GIcon(G_DEFAULT_ICON);
freeparkIcon.image = "http://newmedia.leeds.ac.uk/ug07/cs07ra/rolluk2/
cs07ra/wwwroot/images/indoorpark.png";
freeparkIcon.iconSize = new GSize(35, 40);
freeparkIcon.infoWindowAnchor = new GPoint(0, 0);
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(53.50, -5.00), 7);
map.setUIToDefault();
<cfoutput query="showspots">
markerOptions = { icon:#spot_type#Icon };
var point = new GLatLng(#lat#,#lng#);
var marker = createMarker(point,'#spot_name#<br><img src="images/
#pic1#"><br>#description#<br>#bust_rating#<br>#overall_rating#<br>Added
by: #userfname# #userlname# #userid#')
-----------------------------------------------------------------------------------------------------------------------------
ADDING 'map.addOverlay(marker);' HERE BRINGS BACK THE ORINGINAL
MARKERS ON TOP OF THE NEW ICONS.
-------------------------------------------------------------------------------------------------------------------------------
map.addOverlay(new GMarker(point, markerOptions));
</cfoutput>
--------------------------------------------------------------------------------------------------------------------------------
code end
-----------------------------------------------------------------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.