Files
openlayers/demos/full-screen/full-screen.js
ahocevar 3d62b67172 Introducing ol.overlay.Overlay and an overlayContainer
ol.overlay.Overlay can be used to bind DOM elements to a
coordinate on the map. It has positioning options to support
e.g. popups or image markers that have an anchor at the bottom
and an unknown size.

The overlayContainer stops propagation on mousedown and
touchstart events, so clicks and gestures on overlays don't
trigger any MapBrowserEvent. To make this work reliably, we now
only fire dblclick in mapbrowserevent.js when there was a
previous mousedown or touchstart. The default container for
controls is now the overlayContainer.
2012-09-28 13:01:56 +02:00

32 lines
919 B
JavaScript

goog.require('goog.debug.Console');
goog.require('goog.debug.Logger');
goog.require('goog.debug.Logger.Level');
goog.require('ol.Collection');
goog.require('ol.Coordinate');
goog.require('ol.Map');
goog.require('ol.MapOptions'); // FIXME this should not be required
goog.require('ol.overlay.Overlay');
goog.require('ol.source.MapQuestOpenAerial');
if (goog.DEBUG) {
goog.debug.Console.autoInstall();
goog.debug.Logger.getLogger('ol').setLevel(goog.debug.Logger.Level.INFO);
}
var layer = new ol.layer.TileLayer({
source: new ol.source.MapQuestOpenAerial()
});
var map = new ol.Map(document.getElementById('map'), {
center: new ol.Coordinate(0, 0),
layers: new ol.Collection([layer]),
zoom: 2
});
var vienna = new ol.overlay.Overlay({
map: map,
coordinate: ol.Projection.transformWithCodes(
new ol.Coordinate(16, 48), 'EPSG:4326', 'EPSG:3857'),
element: document.getElementById('vienna')
});