Implement new control architecture

This commit is contained in:
Tom Payne
2012-09-27 17:54:02 +02:00
parent 65b4041aa3
commit 0faab71e3f
7 changed files with 227 additions and 158 deletions

View File

@@ -38,21 +38,26 @@ if (!goog.isNull(webglMap)) {
webglMap.bindTo('rotation', domMap);
}
var attributionControl = new ol.control.Attribution(domMap);
document.getElementById('attribution').appendChild(
attributionControl.getElement());
var attributionControl = new ol.control.Attribution({
map: domMap,
target: document.getElementById('attribution')
});
var domMousePositionControl = new ol.control.MousePosition(domMap,
ol.Projection.getFromCode('EPSG:4326'), ol.CoordinateFormat.hdms,
' ');
document.getElementById('domMousePosition').appendChild(
domMousePositionControl.getElement());
var domMousePositionControl = new ol.control.MousePosition({
coordinateFormat: ol.CoordinateFormat.hdms,
map: domMap,
projection: ol.Projection.getFromCode('EPSG:4326'),
target: document.getElementById('domMousePosition'),
undefinedHtml: ' '
});
var webglMousePositionControl = new ol.control.MousePosition(webglMap,
ol.Projection.getFromCode('EPSG:4326'), ol.CoordinateFormat.hdms,
' ');
document.getElementById('webglMousePosition').appendChild(
webglMousePositionControl.getElement());
var webglMousePositionControl = new ol.control.MousePosition({
coordinateFormat: ol.CoordinateFormat.hdms,
map: webglMap,
projection: ol.Projection.getFromCode('EPSG:4326'),
target: document.getElementById('webglMousePosition'),
undefinedHtml: ' '
});
var keyboardInteraction = new ol.interaction.Keyboard();
keyboardInteraction.addCallback('0', function() {