Created
September 12, 2021 12:51
-
-
Save iamgeoknight/d66c62eef4ac20477a1f1b4658e5082e to your computer and use it in GitHub Desktop.
Creating a Map Click Event Listener
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
let map = new ol.Map({ | |
target: map_div, | |
layers: [ | |
new ol.layer.Tile({ | |
source: new ol.source.OSM() | |
}), | |
wmsLayer | |
], | |
view: new ol.View({ | |
center: ol.proj.fromLonLat(center), | |
zoom: zoom | |
}) | |
}); | |
//Creating a Map Click Event Listener | |
map.on('singleclick', function (e) { | |
//Perform Task on click | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment