Add attribution control by default

This commit is contained in:
Tom Payne
2012-09-28 14:53:09 +02:00
parent 82058412a1
commit 1be9e97489
5 changed files with 3 additions and 20 deletions

View File

@@ -26,11 +26,6 @@
<td><div id="domMousePosition" class="mouseposition"></div></td>
<td><div id="webglMousePosition" class="mouseposition"></div></td>
</tr>
<tr>
<td colspan="2">
<div id="attribution" class="attribution"></div>
</td>
</tr>
</table>
<table>
<tr>

View File

@@ -4,7 +4,6 @@ goog.require('goog.debug.Logger.Level');
goog.require('ol.CoordinateFormat');
goog.require('ol.Map');
goog.require('ol.RendererHint');
goog.require('ol.control.Attribution');
goog.require('ol.control.MousePosition');
goog.require('ol.interaction.Keyboard');
goog.require('ol.layer.TileLayer');
@@ -28,10 +27,6 @@ var domMap = new ol.Map(document.getElementById('domMap'), {
zoom: 0
});
domMap.getControls().push(new ol.control.Attribution({
target: document.getElementById('attribution')
}));
domMap.getControls().push(new ol.control.MousePosition({
coordinateFormat: ol.CoordinateFormat.hdms,
projection: ol.Projection.getFromCode('EPSG:4326'),

View File

@@ -22,11 +22,6 @@
<td><div id="domMap" class="map"></div></td>
<td><div id="webglMap" class="map"></div></td>
</tr>
<tr>
<td colspan="2">
<div id="attribution" class="attribution"></div>
</td>
</tr>
</table>
<script src="loader.js?id=two-layers" type="text/javascript"></script>
</body>

View File

@@ -3,7 +3,6 @@ goog.require('ol.Coordinate');
goog.require('ol.Map');
goog.require('ol.Projection');
goog.require('ol.RendererHint');
goog.require('ol.control.Attribution');
goog.require('ol.layer.TileLayer');
goog.require('ol.source.BingMaps');
goog.require('ol.source.TileJSON');
@@ -31,10 +30,6 @@ var webglMap = new ol.Map(document.getElementById('webglMap'), {
zoom: 5
});
webglMap.getControls().push(new ol.control.Attribution({
target: document.getElementById('attribution')
}));
var domMap = new ol.Map(document.getElementById('domMap'), {
renderer: ol.RendererHint.DOM
});

View File

@@ -11,6 +11,7 @@ goog.require('ol.Constraints');
goog.require('ol.Projection');
goog.require('ol.ResolutionConstraint');
goog.require('ol.RotationConstraint');
goog.require('ol.control.Attribution');
goog.require('ol.control.Zoom');
goog.require('ol.interaction.AltDragRotate');
goog.require('ol.interaction.DblClickZoom');
@@ -231,6 +232,8 @@ ol.MapOptions.createControls_ = function(mapOptionsLiteral) {
var controls = new ol.Collection();
controls.push(new ol.control.Attribution({}));
var zoomDelta = goog.isDef(mapOptionsLiteral.zoomDelta) ?
mapOptionsLiteral.zoomDelta : 4;
controls.push(new ol.control.Zoom({