On Aug 17, 6:57 am, Neil Drinkall <[email protected]> wrote:
> Hi Larry,
>
> Yes I think you are right. I was defining it as an object literal
> (which I thought would have been okay), but doing it "your" way
Which is the way it is documented...
-- Larry
> and
> passing every parameter it does work. Changed and working function:
>
> function AddVehicleMarkerToMap(vehicleObj) {
> var vehLatLng = new google.maps.LatLng(vehicleObj.lat,
> vehicleObj.lon);
> var vehIcon = VEHICLE_ICONS_BASE_URL + "/vehicles" +
> vehicleObj.logo + ".gif";
> var markerImage = new google.maps.MarkerImage(vehIcon,
> new google.maps.Size(24,24),
> new google.maps.Point(0,0),
> new google.maps.Point(12,12));
> var vehicleMarker = new google.maps.Marker ({
> flat: true,
> icon: markerImage,
> position: vehLatLng,
> visible: true,
> zIndex:1000,
> map: map
> });
>
> vehicleObj.marker = vehicleMarker;
> vehicleObj.RemoveFromMap = function()
> {vehicleObj.marker.setMap(null);}
> vehicleList.push(vehicleObj);
> AddListeners(vehicleMarker);
> }
>
> Much appreciated - Can't post a link as it is not publically
> accessible.
--
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.