Google maps V3 GSize has changed
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 = o开发者_运维技巧ptions.labelOffset || new GSize(0, 0);
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:
- Label overlay example for Google Maps API v3 by Marc Ridey
You should probably be using the Size class instead.
精彩评论