Created
October 20, 2025 06:24
-
-
Save DylanCodeCabin/83ccaee2daa5ff02c88ad909178d148f 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
| jQuery(($) => { | |
| if(WPGMZA.isProVersion()) | |
| Parent = WPGMZA.ProInfoWindow; | |
| else | |
| Parent = WPGMZA.InfoWindow; | |
| WPGMZA.OLInfoWindow.prototype.open = function(map, feature) | |
| { | |
| var self = this; | |
| var latLng = feature.getPosition(); | |
| if(!latLng){ | |
| return false; | |
| } | |
| if(!Parent.prototype.open.call(this, map, feature)){ | |
| return false; | |
| } | |
| // Set parent for events to bubble up | |
| this.parent = map; | |
| if(this.overlay) | |
| this.feature.map.olMap.removeOverlay(this.overlay); | |
| this.overlay = new ol.Overlay({ | |
| element: this.element, | |
| stopEvent: true, | |
| insertFirst: false | |
| }); | |
| this.overlay.setPosition(ol.proj.fromLonLat([ | |
| latLng.lng, | |
| latLng.lat | |
| ])); | |
| self.feature.map.olMap.addOverlay(this.overlay); | |
| $(this.element).show(); | |
| this.setContent(this.content); | |
| if(WPGMZA.OLMarker.renderMode == WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER) | |
| { | |
| WPGMZA.getImageDimensions(feature.getIcon(), function(size) { | |
| $(self.element).css({left: Math.round(size.width / 2) + "px"}); | |
| }); | |
| } | |
| /* Apply scroll fix for OpenLayers */ | |
| this.autoResize(); | |
| this.trigger("infowindowopen"); | |
| this.trigger("domready"); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment