Advertisement
Guest User

mapMarkerConstructor Service

a guest
Jun 27th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function mapMarkerConstructor () {
  2.   class GoogleOverlayView {
  3.     constructor(element, latlng) {
  4.       this.element = element;
  5.       this.latlng = latlng;
  6.     }
  7.  
  8.     draw() {
  9.       let panes = this.getPanes();
  10.       let point = this.getProjection().fromLatLngToDivPixel(this.latlng);
  11.       panes.overlayImage.appendChild(this.element[0]);
  12.       if (point) {
  13.         this.element.css('left', `${point.x}px`);
  14.         this.element.css('top', `${point.y}px`);
  15.       }
  16.     }
  17.  
  18.     onRemove() {}
  19.   }
  20.  
  21.   GoogleOverlayView.prototype = new google.maps.OverlayView();
  22.   this.GoogleOverlayView = GoogleOverlayView;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement