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
+4 -1
View File
@@ -23,4 +23,7 @@ var map = new ol.Map(document.getElementById('map'), {
layers: new ol.Collection([layer]),
zoom: 2
});
var zoom = new ol.control.Zoom(map, 4);
var zoom = new ol.control.Zoom({
delta: 4,
map: map
});
+18 -13
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() {
+4 -3
View File
@@ -39,6 +39,7 @@ domMap.bindTo('layers', webglMap);
domMap.bindTo('resolution', webglMap);
domMap.bindTo('rotation', webglMap);
var attributionControl = new ol.control.Attribution(webglMap);
document.getElementById('attribution').appendChild(
attributionControl.getElement());
var attributionControl = new ol.control.Attribution({
map: webglMap,
target: document.getElementById('attribution')
});