ol3 is now internal, ol is now external
As discussed with @ahocevar, @elemoine and @tschaub.
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
var map = ol3.map({
|
||||
var map = ol.map({
|
||||
renderTo: 'map',
|
||||
layers: [ol3.layer.osm()],
|
||||
layers: [ol.layer.osm()],
|
||||
center: [45, 5],
|
||||
zoom: 10
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Projection');
|
||||
goog.require('ol3.Coordinate');
|
||||
goog.require('ol3.Projection');
|
||||
|
||||
|
||||
var outputElement = document.getElementById('output');
|
||||
|
||||
var point, transformedPoint;
|
||||
|
||||
point = new ol.Coordinate(-626172.13571216376, 6887893.4928337997);
|
||||
transformedPoint = ol.Projection.transformWithCodes(
|
||||
point = new ol3.Coordinate(-626172.13571216376, 6887893.4928337997);
|
||||
transformedPoint = ol3.Projection.transformWithCodes(
|
||||
point, 'GOOGLE', 'WGS84');
|
||||
outputElement.appendChild(goog.dom.createTextNode(transformedPoint.toString()));
|
||||
|
||||
@@ -17,7 +17,7 @@ Proj4js.defs['EPSG:21781'] =
|
||||
'+x_0=600000 +y_0=200000 +ellps=bessel ' +
|
||||
'+towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs';
|
||||
|
||||
point = new ol.Coordinate(7.439583333333333, 46.95240555555556);
|
||||
transformedPoint = ol.Projection.transformWithCodes(
|
||||
point = new ol3.Coordinate(7.439583333333333, 46.95240555555556);
|
||||
transformedPoint = ol3.Projection.transformWithCodes(
|
||||
point, 'EPSG:4326', 'EPSG:21781');
|
||||
outputElement.appendChild(goog.dom.createTextNode(transformedPoint.toString()));
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
goog.require('goog.debug.Console');
|
||||
goog.require('goog.debug.Logger');
|
||||
goog.require('goog.debug.Logger.Level');
|
||||
goog.require('ol.CoordinateFormat');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.control.Attribution');
|
||||
goog.require('ol.control.MousePosition');
|
||||
goog.require('ol.createMap');
|
||||
goog.require('ol.interaction.Keyboard');
|
||||
goog.require('ol.layer.MapQuestOpenAerial');
|
||||
goog.require('ol3.CoordinateFormat');
|
||||
goog.require('ol3.RendererHint');
|
||||
goog.require('ol3.control.Attribution');
|
||||
goog.require('ol3.control.MousePosition');
|
||||
goog.require('ol3.createMap');
|
||||
goog.require('ol3.interaction.Keyboard');
|
||||
goog.require('ol3.layer.MapQuestOpenAerial');
|
||||
|
||||
|
||||
if (goog.DEBUG) {
|
||||
@@ -17,22 +17,22 @@ if (goog.DEBUG) {
|
||||
|
||||
|
||||
|
||||
var layer = new ol.layer.MapQuestOpenAerial();
|
||||
var layer = new ol3.layer.MapQuestOpenAerial();
|
||||
|
||||
var layers = new ol.Collection();
|
||||
var layers = new ol3.Collection();
|
||||
layers.push(layer);
|
||||
|
||||
var domMap = ol.createMap(
|
||||
var domMap = ol3.createMap(
|
||||
document.getElementById('domMap'),
|
||||
{'layers': layers},
|
||||
ol.RendererHint.DOM);
|
||||
domMap.setCenter(new ol.Coordinate(0, 0));
|
||||
ol3.RendererHint.DOM);
|
||||
domMap.setCenter(new ol3.Coordinate(0, 0));
|
||||
domMap.setResolution(layer.getStore().getResolutions()[0]);
|
||||
|
||||
var webglMap = ol.createMap(
|
||||
var webglMap = ol3.createMap(
|
||||
document.getElementById('webglMap'),
|
||||
{},
|
||||
ol.RendererHint.WEBGL);
|
||||
ol3.RendererHint.WEBGL);
|
||||
if (!goog.isNull(webglMap)) {
|
||||
webglMap.bindTo('center', domMap);
|
||||
webglMap.bindTo('layers', domMap);
|
||||
@@ -40,21 +40,23 @@ if (!goog.isNull(webglMap)) {
|
||||
webglMap.bindTo('rotation', domMap);
|
||||
}
|
||||
|
||||
var attributionControl = new ol.control.Attribution(domMap);
|
||||
var attributionControl = new ol3.control.Attribution(domMap);
|
||||
document.getElementById('attribution').appendChild(
|
||||
attributionControl.getElement());
|
||||
|
||||
var domMousePositionControl = new ol.control.MousePosition(domMap,
|
||||
ol.Projection.getFromCode('EPSG:4326'), ol.CoordinateFormat.hdms, ' ');
|
||||
var domMousePositionControl = new ol3.control.MousePosition(domMap,
|
||||
ol3.Projection.getFromCode('EPSG:4326'), ol3.CoordinateFormat.hdms,
|
||||
' ');
|
||||
document.getElementById('domMousePosition').appendChild(
|
||||
domMousePositionControl.getElement());
|
||||
|
||||
var webglMousePositionControl = new ol.control.MousePosition(webglMap,
|
||||
ol.Projection.getFromCode('EPSG:4326'), ol.CoordinateFormat.hdms, ' ');
|
||||
var webglMousePositionControl = new ol3.control.MousePosition(webglMap,
|
||||
ol3.Projection.getFromCode('EPSG:4326'), ol3.CoordinateFormat.hdms,
|
||||
' ');
|
||||
document.getElementById('webglMousePosition').appendChild(
|
||||
webglMousePositionControl.getElement());
|
||||
|
||||
var keyboardInteraction = new ol.interaction.Keyboard();
|
||||
var keyboardInteraction = new ol3.interaction.Keyboard();
|
||||
keyboardInteraction.addCallback('0', function() {
|
||||
layer.setBrightness(0);
|
||||
layer.setContrast(0);
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.control.Attribution');
|
||||
goog.require('ol.createMap');
|
||||
goog.require('ol.layer.BingMaps');
|
||||
goog.require('ol.layer.TileJSON');
|
||||
goog.require('ol3.Coordinate');
|
||||
goog.require('ol3.RendererHint');
|
||||
goog.require('ol3.control.Attribution');
|
||||
goog.require('ol3.createMap');
|
||||
goog.require('ol3.layer.BingMaps');
|
||||
goog.require('ol3.layer.TileJSON');
|
||||
|
||||
|
||||
var layer1 = new ol.layer.BingMaps(
|
||||
ol.BingMapsStyle.AERIAL,
|
||||
var layer1 = new ol3.layer.BingMaps(
|
||||
ol3.BingMapsStyle.AERIAL,
|
||||
'AheP841R-MsLErKQChaTba_xDoOCl40-EeTubD9uNhNAyQTePwFY9iVD1_pyqqlE');
|
||||
var layer2 = new ol.layer.TileJSON(
|
||||
var layer2 = new ol3.layer.TileJSON(
|
||||
'http://api.tiles.mapbox.com/v3/mapbox.va-quake-aug.jsonp');
|
||||
|
||||
var layers = new ol.Collection([layer1, layer2]);
|
||||
var layers = new ol3.Collection([layer1, layer2]);
|
||||
|
||||
var webglMap = ol.createMap(
|
||||
var webglMap = ol3.createMap(
|
||||
document.getElementById('webglMap'),
|
||||
{'layers': new ol.Collection([layer1, layer2])},
|
||||
ol.RendererHint.WEBGL);
|
||||
{'layers': new ol3.Collection([layer1, layer2])},
|
||||
ol3.RendererHint.WEBGL);
|
||||
|
||||
goog.events.listen(layer2, goog.events.EventType.LOAD, function() {
|
||||
webglMap.setUserCenter(new ol.Coordinate(-77.93254999999999, 37.9555));
|
||||
webglMap.setUserCenter(new ol3.Coordinate(-77.93254999999999, 37.9555));
|
||||
webglMap.setResolution(layer2.getStore().getResolutions()[5]);
|
||||
});
|
||||
|
||||
var domMap = ol.createMap(
|
||||
var domMap = ol3.createMap(
|
||||
document.getElementById('domMap'),
|
||||
{},
|
||||
ol.RendererHint.DOM);
|
||||
ol3.RendererHint.DOM);
|
||||
domMap.bindTo('center', webglMap);
|
||||
domMap.bindTo('layers', webglMap);
|
||||
domMap.bindTo('resolution', webglMap);
|
||||
domMap.bindTo('rotation', webglMap);
|
||||
|
||||
var attributionControl = new ol.control.Attribution(webglMap);
|
||||
var attributionControl = new ol3.control.Attribution(webglMap);
|
||||
document.getElementById('attribution').appendChild(
|
||||
attributionControl.getElement());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user