Merge pull request #3096 from fredj/example-cleanup

popup example cleanup / simplification
This commit is contained in:
Frédéric Junod
2015-01-08 09:07:25 +01:00
3 changed files with 4 additions and 7 deletions

View File

@@ -10,10 +10,8 @@
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style type="text/css">
.ol-popup {
display: none;
position: absolute;
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));
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
padding: 15px;

View File

@@ -20,7 +20,7 @@ var closer = document.getElementById('popup-closer');
* @return {boolean} Don't follow the href.
*/
closer.onclick = function() {
container.style.display = 'none';
overlay.setPosition(undefined);
closer.blur();
return false;
};
@@ -65,9 +65,7 @@ map.on('click', function(evt) {
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
coordinate, 'EPSG:3857', 'EPSG:4326'));
overlay.setPosition(coordinate);
content.innerHTML = '<p>You clicked here:</p><code>' + hdms +
'</code>';
container.style.display = 'block';
overlay.setPosition(coordinate);
});

View File

@@ -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
* is anchored at.
* @observable