首页 > 其他 > 详细

how to add borders for a google map marker 谷歌地图 自定义图钉

时间:2014-07-08 17:16:59      阅读:411      评论:0      收藏:0      [点我收藏+]
If you are not satisfied with default Google map Marker (Default google marker can only be a icon, image or shape), for example adding a border, then you should use richmarker!

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/

Inside richmarker:

RickMarker extends from google.maps.OverlayView

RichMarker.prototype.onAdd
     
     var panes = this.getPanes();//Returns the panes in which this OverlayView can be rendered. The panes are not initialized until onAdd is called by the API.
     panes.overlayMouseTarget.appendChild();//This pane contains elements that receive DOM mouse events, such as the transparent targets for markers. It is above the floatShadow, so that markers in the shadow of the info window can be clickable. (Pane 5).

RichMarker.prototype.draw

       var projection = this.getProjection(); //Returns the MapCanvasProjection object associated with this OverlayView. The projection is not initialized until onAdd is called by the API.
       var latLng = (this.get(‘position‘));
       var pos = projection.fromLatLngToDivPixel(latLng);//Computes the pixel coordinates of the given geographical location in the DOM element that holds the draggable map.
       var offset = this.getOffset_();
       this.markerWrapper_.style[‘top‘] = (pos.y + offset.height) + ‘px‘;
       this.markerWrapper_.style[‘left‘] = (pos.x + offset.width) + ‘px‘;

how to add borders for a google map marker 谷歌地图 自定义图钉,布布扣,bubuko.com

how to add borders for a google map marker 谷歌地图 自定义图钉

原文:http://blog.csdn.net/baoeni/article/details/37373113

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!