views:

217

answers:

2

I am switching google maps from v2 to v3 and I am running into a problem with finding the conversion from GSize. Does anyone know how to make the change.

opts = {
    'labelText': infoname,
    'labelClass': 'citymarkers',
    'labelOffset': new GSize(-35, -40)
};

var marker = new LabeledMarker( 
    new google.maps.LatLng(this.lat, this.lng), 
    opts);

this.labelOffset = options.labelOffset || new GSize(0, 0);
A: 

You should probably be using the Size class instead.

tomlog
I tried using 'labelOffset': new Size(-35, -40) but i got this errorSize is not defined
Matt
@Matt: You would have to use `google.maps.Size` but I think it still won't work, since `LabeledMarker` is an extension for the v2 API.
Daniel Vassallo
+1  A: 

The LabeledMarker class you are using is a third-party extension and not part of the Google Maps API.

There is a utility library for the v3 API similar to the v2 version, and there is an extension called MarkerWithLabel. You may want to try that instead.

You may also be interested in checking out the following article for an alternative v3 solution:

Daniel Vassallo