Last active
February 6, 2021 11:51
-
-
Save iamgeoknight/ebf3bfaeffd12d68368ffd9c88705484 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Create overlay | |
*/ | |
class Overlay { | |
//Contrctor accepts map object, overlay html element, overlay offset, overlay positioning and overlay class | |
constructor(map, element = document.getElementById("popup"), offset = [0, -15], positioning = 'bottom-center', className = 'ol-tooltip-measure ol-tooltip .ol-tooltip-static') { | |
this.map = map; | |
this.overlay = new ol.Overlay({ | |
element: element, | |
offset: offset, | |
positioning: positioning, | |
className: className | |
}); | |
this.overlay.setPosition([0,0]); | |
this.overlay.element.style.display = 'block'; | |
this.map.addOverlay(this.overlay); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment