Hi, I am pretty new to both javascript and the Google Maps API, but
have been moving along smoothly until I attempted to extend the
GMarker object to add a 'desc' field
Here is the code for the new marker object:
function CustomMarker( latlng, options ){
this.latlng = latlng;
this.desc = options.desc || "";
GMarker.apply( this, arguments );
}
CustomMarker.prototype = new GMarker( new GLatlng( 0, 0 ) );
CustomMarker.prototype.initialize = function( map ){
alert( "TEST" );
GMarker.prototype.initialize.call( this, map );
}
CustomMarker.prototype.remove = function() {
GMarker.prototype.remove.call( this );
}
It constructs, but runs into a problem when i I try to add it to the
map with: gMap.addOverlay( marker );
I suspect that I have not done the javascript inheritance correctly -
I was rather confused by how it works.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---