Convert ol.MapBrowserEvent#get* methods into properties
This commit is contained in:
@@ -151,6 +151,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
displayFeatureInfo(pixel);
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
@@ -148,6 +148,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
displayFeatureInfo(pixel);
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
@@ -89,6 +89,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
displayFeatureInfo(pixel);
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ map.addOverlay(popup);
|
||||
|
||||
// display popup on click
|
||||
map.on('singleclick', function(evt) {
|
||||
var feature = map.forEachFeatureAtPixel(evt.getPixel(),
|
||||
var feature = map.forEachFeatureAtPixel(evt.pixel,
|
||||
function(feature, layer) {
|
||||
return feature;
|
||||
});
|
||||
|
||||
@@ -111,8 +111,7 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var coordinate = evt.getCoordinate();
|
||||
displaySnap(coordinate);
|
||||
displaySnap(evt.coordinate);
|
||||
});
|
||||
|
||||
var imageStyle = new ol.style.Circle({
|
||||
|
||||
@@ -95,6 +95,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
displayFeatureInfo(pixel);
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
@@ -91,5 +91,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
displayFeatureInfo(evt.getPixel());
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
@@ -97,5 +97,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
displayFeatureInfo(evt.getPixel());
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
@@ -55,6 +55,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
displayFeatureInfo(pixel);
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ map.addOverlay(popup);
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var element = popup.getElement();
|
||||
var coordinate = evt.getCoordinate();
|
||||
var coordinate = evt.coordinate;
|
||||
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
|
||||
coordinate, 'EPSG:3857', 'EPSG:4326'));
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ var map = new ol.Map({
|
||||
* Add a click handler to the map to render the popup.
|
||||
*/
|
||||
map.on('singleclick', function(evt) {
|
||||
var coordinate = evt.getCoordinate();
|
||||
var coordinate = evt.coordinate;
|
||||
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
|
||||
coordinate, 'EPSG:3857', 'EPSG:4326'));
|
||||
|
||||
|
||||
@@ -97,8 +97,7 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var coordinate = evt.getCoordinate();
|
||||
displaySnap(coordinate);
|
||||
displaySnap(evt.coordinate);
|
||||
});
|
||||
|
||||
var imageStyle = new ol.style.Circle({
|
||||
|
||||
@@ -94,6 +94,5 @@ $(map.getViewport()).on('mousemove', function(evt) {
|
||||
});
|
||||
|
||||
map.on('singleclick', function(evt) {
|
||||
var pixel = evt.getPixel();
|
||||
displayFeatureInfo(pixel);
|
||||
displayFeatureInfo(evt.pixel);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user