Hi,
I create a new marker like this:
marker = new google.maps.Marker( {
position : latlng,
map : map,
icon: 'http://google-maps-icons.googlecode.com/files/car.png'
});
In FireBug, I see the HTTP GET for the car.png, and it is returned, so
the url is valid.
When I load my map, the marker does not appear. If I remove the icon
property:
marker = new google.maps.Marker( {
position : latlng,
map : map
});
The default red marker shows up.
I init the map like this:
<script src="http://maps.google.com/maps/api/js?sensor=false"></
script>
<div id="map_canvas" style="position: absolute; width: 100%; height:
100%;'"></div>
// the google maps object
var map;
// marker for our current location
var marker;
var defLat = 25.772687243658137;
var defLon = -80.20843505859375;
function load() {
var latlng = new google.maps.LatLng(defLat, defLon);
var myOptions = {
zoom : 8,
center : latlng,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
addCurrentLocation(latlng);
}
function addCurrentLocation(latlng) {
marker = new google.maps.Marker( {
position : latlng,
map : map,
icon: 'http://google-maps-icons.googlecode.com/files/car.png'
});
}
Any clue what I am doing wrong here? I also breakpoint the marker
constructor, and I can see the icon property is set to the url.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.