Use ol.control.MousePosition in demo
This commit is contained in:
@@ -21,6 +21,9 @@
|
|||||||
<td><div id="domMap" class="map"></div></td>
|
<td><div id="domMap" class="map"></div></td>
|
||||||
<td><div id="webglMap" class="map"></div></td>
|
<td><div id="webglMap" class="map"></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><div id="domMousePosition" class="mouseposition"></div></td>
|
||||||
|
<td><div id="webglMousePosition" class="mouseposition"></div></td>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<div id="attribution" class="attribution"></div>
|
<div id="attribution" class="attribution"></div>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
goog.require('ol.CoordinateFormat');
|
||||||
goog.require('ol.RendererHint');
|
goog.require('ol.RendererHint');
|
||||||
goog.require('ol.control.Attribution');
|
goog.require('ol.control.Attribution');
|
||||||
|
goog.require('ol.control.MousePosition');
|
||||||
goog.require('ol.createMap');
|
goog.require('ol.createMap');
|
||||||
goog.require('ol.interaction.Keyboard');
|
goog.require('ol.interaction.Keyboard');
|
||||||
goog.require('ol.layer.MapQuestOpenAerial');
|
goog.require('ol.layer.MapQuestOpenAerial');
|
||||||
@@ -32,6 +34,16 @@ var attributionControl = new ol.control.Attribution(domMap);
|
|||||||
document.getElementById('attribution').appendChild(
|
document.getElementById('attribution').appendChild(
|
||||||
attributionControl.getElement());
|
attributionControl.getElement());
|
||||||
|
|
||||||
|
var domMousePositionControl = new ol.control.MousePosition(domMap,
|
||||||
|
ol.Projection.getFromCode('EPSG:4326'), ol.CoordinateFormat.hdms, ' ');
|
||||||
|
document.getElementById('domMousePosition').appendChild(
|
||||||
|
domMousePositionControl.getElement());
|
||||||
|
|
||||||
|
var webglMousePositionControl = new ol.control.MousePosition(webglMap,
|
||||||
|
ol.Projection.getFromCode('EPSG:4326'), ol.CoordinateFormat.hdms, ' ');
|
||||||
|
document.getElementById('webglMousePosition').appendChild(
|
||||||
|
webglMousePositionControl.getElement());
|
||||||
|
|
||||||
var keyboardInteraction = new ol.interaction.Keyboard();
|
var keyboardInteraction = new ol.interaction.Keyboard();
|
||||||
keyboardInteraction.addCallback('0', function() {
|
keyboardInteraction.addCallback('0', function() {
|
||||||
layer.setBrightness(0);
|
layer.setBrightness(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user