Merge pull request #3096 from fredj/example-cleanup
popup example cleanup / simplification
This commit is contained in:
@@ -10,10 +10,8 @@
|
|||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.ol-popup {
|
.ol-popup {
|
||||||
display: none;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
-moz-box-shadow: 0 1px 4px rgba(0,0,0,0.2);
|
|
||||||
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
|
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
|
||||||
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
|
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|||||||
+2
-4
@@ -20,7 +20,7 @@ var closer = document.getElementById('popup-closer');
|
|||||||
* @return {boolean} Don't follow the href.
|
* @return {boolean} Don't follow the href.
|
||||||
*/
|
*/
|
||||||
closer.onclick = function() {
|
closer.onclick = function() {
|
||||||
container.style.display = 'none';
|
overlay.setPosition(undefined);
|
||||||
closer.blur();
|
closer.blur();
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
@@ -65,9 +65,7 @@ map.on('click', function(evt) {
|
|||||||
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
|
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
|
||||||
coordinate, 'EPSG:3857', 'EPSG:4326'));
|
coordinate, 'EPSG:3857', 'EPSG:4326'));
|
||||||
|
|
||||||
overlay.setPosition(coordinate);
|
|
||||||
content.innerHTML = '<p>You clicked here:</p><code>' + hdms +
|
content.innerHTML = '<p>You clicked here:</p><code>' + hdms +
|
||||||
'</code>';
|
'</code>';
|
||||||
container.style.display = 'block';
|
overlay.setPosition(coordinate);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-1
@@ -348,7 +348,8 @@ goog.exportProperty(
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the position for this overlay.
|
* Set the position for this overlay. If the position is `undefined` the
|
||||||
|
* overlay is hidden.
|
||||||
* @param {ol.Coordinate|undefined} position The spatial point that the overlay
|
* @param {ol.Coordinate|undefined} position The spatial point that the overlay
|
||||||
* is anchored at.
|
* is anchored at.
|
||||||
* @observable
|
* @observable
|
||||||
|
|||||||
Reference in New Issue
Block a user