If you subclass the marker, you need to continue to use the Marker
interface.
you cannot access position or map directly as properties.
For example:
function MyMarker(opts){
this.setPosition(opts.position);
this.setMap(opts.map);
}
MyMarker.prototype = new google.maps.Marker();
or even:
function MyMarker(opts){
this.setOptions(opts);
}
MyMarker.prototype = new google.maps.Marker();
On Wed, Jul 14, 2010 at 3:32 PM, lycovian <[email protected]> wrote:
> Is this possible? I've been banging my head on this for a while and
> simply can't get it to work.
>
> <snip>
> function MyMarker(opts){
> this.position = opts.position;
> this.map = opts.map;
> }
> MyMarker.prototype = new google.maps.Marker();
> // a different attempt
> //MyMarker.prototype = new google.maps.Marker(new
> google.maps.LatLng(0,0));
> </snip>
>
> --
> 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]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
--
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.