HTML5 Canvas Placemark for Google Maps API v3

I am looking for a way to create complex labels (or overlays attached to labels).

Is there a way (I did not find it) using the v3 api card to attach / overlay a on the label?

Or, do I need to draw outside the Google api, and then you have a / s listener that starts the redraw when the user clicks on the map?

+5
source share
3 answers

You extend google.maps.OverlayView with an object that overrides onAdd (), draw () and onRemove ()

onAdd , , google.maps.MapPanes, . . :

CustomOverlayView.prototype.initPanes = function() {
var panes = this.getPanes(); //object of type google.maps.MapPanes
this.drawPane = jQuery(panes.floatPane); //we will initialize our stuff in this div element
this.drawPane.attr("id", "map-draw-pane"); //conceivable to want to reference this, usefull for debugging
this.drawPane.css("background-color", "transparent"); //DONT COVER THE GOOGLE COPYRIGHT
};

, google.maps.LatLng Point x y. google.maps.MapCanvasProjection, , , google.maps.LatLng, ( ).

var projection = this.getProjection();//google.maps.MapCanvasProjection
var drawingLocationPoint = projection.fromLatLngToContainerPixel(markerData.location);

, Google : http://www.samedwards.net

+5

All Articles