Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions

View File

@@ -1,3 +1,10 @@
/*
* Jugl.js -- JavaScript Template Library
*
* Copyright 2007-2010 Tim Schaub
* Released under the MIT license. Please see
* http://github.com/tschaub/jugl/blob/master/license.txt for the full license.
*/
/*
* Jugl.js -- JavaScript Template Library
*

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,27 +1,27 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.easing');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_easing_ from '../src/ol/easing.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var london = ol.proj.fromLonLat([-0.12755, 51.507222]);
var moscow = ol.proj.fromLonLat([37.6178, 55.7517]);
var istanbul = ol.proj.fromLonLat([28.9744, 41.0128]);
var rome = ol.proj.fromLonLat([12.5, 41.9]);
var bern = ol.proj.fromLonLat([7.4458, 46.95]);
var london = _ol_proj_.fromLonLat([-0.12755, 51.507222]);
var moscow = _ol_proj_.fromLonLat([37.6178, 55.7517]);
var istanbul = _ol_proj_.fromLonLat([28.9744, 41.0128]);
var rome = _ol_proj_.fromLonLat([12.5, 41.9]);
var bern = _ol_proj_.fromLonLat([7.4458, 46.95]);
var view = new ol.View({
var view = new _ol_View_({
center: istanbul,
zoom: 6
});
var map = new ol.Map({
var map = new _ol_Map_({
target: 'map',
layers: [
new ol.layer.Tile({
new _ol_layer_Tile_({
preload: 4,
source: new ol.source.OSM()
source: new _ol_source_OSM_()
})
],
// Improve user experience by loading tiles while animating. Will make
@@ -79,11 +79,11 @@ onClick('rotate-around-rome', function() {
view.animate({
rotation: rotation + Math.PI,
anchor: rome,
easing: ol.easing.easeIn
easing: _ol_easing_.easeIn
}, {
rotation: rotation + 2 * Math.PI,
anchor: rome,
easing: ol.easing.easeOut
easing: _ol_easing_.easeOut
});
});
@@ -119,11 +119,11 @@ onClick('spin-to-rome', function() {
center[1] + (rome[1] - center[1]) / 2
],
rotation: Math.PI,
easing: ol.easing.easeIn
easing: _ol_easing_.easeIn
}, {
center: rome,
rotation: 2 * Math.PI,
easing: ol.easing.easeOut
easing: _ol_easing_.easeOut
});
});

View File

@@ -1,29 +1,29 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Image');
goog.require('ol.source.OSM');
goog.require('ol.source.ImageArcGISRest');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_ImageArcGISRest_ from '../src/ol/source/ImageArcGISRest.js';
var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
new ol.layer.Image({
source: new ol.source.ImageArcGISRest({
new _ol_layer_Image_({
source: new _ol_source_ImageArcGISRest_({
ratio: 1,
params: {},
url: url
})
})
];
var map = new ol.Map({
var map = new _ol_Map_({
layers: layers,
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-10997148, 4569099],
zoom: 4
})

View File

@@ -1,27 +1,27 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.TileArcGISRest');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_TileArcGISRest_ from '../src/ol/source/TileArcGISRest.js';
var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
new ol.layer.Tile({
new _ol_layer_Tile_({
extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileArcGISRest({
source: new _ol_source_TileArcGISRest_({
url: url
})
})
];
var map = new ol.Map({
var map = new _ol_Map_({
layers: layers,
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-10997148, 4569099],
zoom: 4
})

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.Attribution');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_Attribution_ from '../src/ol/control/Attribution.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var attribution = new ol.control.Attribution({
var attribution = new _ol_control_Attribution_({
collapsible: false
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
controls: ol.control.defaults({attribution: false}).extend([attribution]),
controls: _ol_control_.defaults({attribution: false}).extend([attribution]),
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var styles = [
@@ -15,10 +15,10 @@ var styles = [
var layers = [];
var i, ii;
for (i = 0, ii = styles.length; i < ii; ++i) {
layers.push(new ol.layer.Tile({
layers.push(new _ol_layer_Tile_({
visible: false,
preload: Infinity,
source: new ol.source.BingMaps({
source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: styles[i]
// use maxZoom 19 to see stretched tiles instead of the BingMaps
@@ -27,13 +27,13 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
})
}));
}
var map = new ol.Map({
var map = new _ol_Map_({
layers: layers,
// Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true,
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-6655.5402445057125, 6709968.258934638],
zoom: 13
})

View File

@@ -1,29 +1,29 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
// Create separate layers for red, green an blue circles.
//
// Every layer has one feature that is styled with a circle, together the
// features form the corners of an equilateral triangle and their styles overlap
var redLayer = new ol.layer.Vector({
source: new ol.source.Vector({
features: [new ol.Feature(new ol.geom.Point([0, 0]))]
var redLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
features: [new _ol_Feature_(new _ol_geom_Point_([0, 0]))]
}),
style: new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
style: new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.8)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'rgb(255,0,0)',
width: 15
}),
@@ -31,17 +31,17 @@ var redLayer = new ol.layer.Vector({
})
})
});
var greenLayer = new ol.layer.Vector({
source: new ol.source.Vector({
var greenLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
// 433.013 is roughly 250 * Math.sqrt(3)
features: [new ol.Feature(new ol.geom.Point([250, 433.013]))]
features: [new _ol_Feature_(new _ol_geom_Point_([250, 433.013]))]
}),
style: new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
style: new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(0,255,0,0.8)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'rgb(0,255,0)',
width: 15
}),
@@ -49,16 +49,16 @@ var greenLayer = new ol.layer.Vector({
})
})
});
var blueLayer = new ol.layer.Vector({
source: new ol.source.Vector({
features: [new ol.Feature(new ol.geom.Point([500, 0]))]
var blueLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
features: [new _ol_Feature_(new _ol_geom_Point_([500, 0]))]
}),
style: new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
style: new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.8)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'rgb(0,0,255)',
width: 15
}),
@@ -69,14 +69,14 @@ var blueLayer = new ol.layer.Vector({
// Create the map, the view is centered on the triangle. Zooming and panning is
// restricted to a sane area
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
redLayer,
greenLayer,
blueLayer
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [250, 220],
extent: [0, 0, 500, 500],
resolution: 4,

View File

@@ -1,46 +1,46 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.events.condition');
goog.require('ol.format.GeoJSON');
goog.require('ol.interaction.DragBox');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_events_condition_ from '../src/ol/events/condition.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_interaction_DragBox_ from '../src/ol/interaction/DragBox.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var vectorSource = new ol.source.Vector({
var vectorSource = new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON()
format: new _ol_format_GeoJSON_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
new ol.layer.Vector({
new _ol_layer_Vector_({
source: vectorSource
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
});
// a normal select interaction to handle click
var select = new ol.interaction.Select();
var select = new _ol_interaction_Select_();
map.addInteraction(select);
var selectedFeatures = select.getFeatures();
// a DragBox interaction used to select features by drawing boxes
var dragBox = new ol.interaction.DragBox({
condition: ol.events.condition.platformModifierKeyOnly
var dragBox = new _ol_interaction_DragBox_({
condition: _ol_events_condition_.platformModifierKeyOnly
});
map.addInteraction(dragBox);

View File

@@ -1,16 +1,16 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-8730000, 5930000],
rotation: Math.PI / 5,
zoom: 8

View File

@@ -1,21 +1,21 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.format.GeoJSON');
goog.require('ol.has');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_extent_ from '../src/ol/extent.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_has_ from '../src/ol/has.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
// Gradient and pattern are in canvas pixel space, so we adjust for the
// renderer's pixel ratio
var pixelRatio = ol.has.DEVICE_PIXEL_RATIO;
var pixelRatio = _ol_has_.DEVICE_PIXEL_RATIO;
// Generate a rainbow gradient
function gradient(feature, resolution) {
@@ -25,7 +25,7 @@ function gradient(feature, resolution) {
// we just divide the geometry's extent width by resolution and multiply with
// pixelRatio to match the renderer's pixel coordinate system.
var grad = context.createLinearGradient(0, 0,
ol.extent.getWidth(extent) / resolution * pixelRatio, 0);
_ol_extent_.getWidth(extent) / resolution * pixelRatio, 0);
grad.addColorStop(0, 'red');
grad.addColorStop(1 / 6, 'orange');
grad.addColorStop(2 / 6, 'yellow');
@@ -57,10 +57,10 @@ var pattern = (function() {
}());
// Generate style for gradient or pattern fill
var fill = new ol.style.Fill();
var style = new ol.style.Style({
var fill = new _ol_style_Fill_();
var style = new _ol_style_Style_({
fill: fill,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#333',
width: 2
})
@@ -81,22 +81,22 @@ var getStackedStyle = function(feature, resolution) {
};
// Create a vector layer that makes use of the style function above…
var vectorLayer = new ol.layer.Vector({
source: new ol.source.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON()
format: new _ol_format_GeoJSON_()
}),
style: getStackedStyle
});
// … finally create a map with that layer.
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
vectorLayer
],
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([7, 52]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([7, 52]),
zoom: 3
})
});

View File

@@ -1,33 +1,33 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.TileDebug');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_TileDebug_ from '../src/ol/source/TileDebug.js';
var osmSource = new ol.source.OSM();
var map = new ol.Map({
var osmSource = new _ol_source_OSM_();
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
new _ol_layer_Tile_({
source: osmSource
}),
new ol.layer.Tile({
source: new ol.source.TileDebug({
new _ol_layer_Tile_({
source: new _ol_source_TileDebug_({
projection: 'EPSG:3857',
tileGrid: osmSource.getTileGrid()
})
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
center: ol.proj.transform(
view: new _ol_View_({
center: _ol_proj_.transform(
[-0.1275, 51.507222], 'EPSG:4326', 'EPSG:3857'),
zoom: 10
})

View File

@@ -1,8 +1,8 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.CartoDB');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_CartoDB_ from '../src/ol/source/CartoDB.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var mapConfig = {
'layers': [{
@@ -15,22 +15,22 @@ var mapConfig = {
}]
};
var cartoDBSource = new ol.source.CartoDB({
var cartoDBSource = new _ol_source_CartoDB_({
account: 'documentation',
config: mapConfig
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
new ol.layer.Tile({
new _ol_layer_Tile_({
source: cartoDBSource
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,56 +1,56 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var source = new ol.source.Vector({
var source = new _ol_source_Vector_({
url: 'data/geojson/switzerland.geojson',
format: new ol.format.GeoJSON()
format: new _ol_format_GeoJSON_()
});
var style = new ol.style.Style({
fill: new ol.style.Fill({
var style = new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#319FD3',
width: 1
}),
image: new ol.style.Circle({
image: new _ol_style_Circle_({
radius: 5,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#319FD3',
width: 1
})
})
});
var vectorLayer = new ol.layer.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: source,
style: style
});
var view = new ol.View({
var view = new _ol_View_({
center: [0, 0],
zoom: 1
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
vectorLayer
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}

View File

@@ -1,17 +1,17 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Cluster');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
goog.require('ol.style.Text');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Cluster_ from '../src/ol/source/Cluster.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js';
var distance = document.getElementById('distance');
@@ -21,38 +21,38 @@ var features = new Array(count);
var e = 4500000;
for (var i = 0; i < count; ++i) {
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
features[i] = new ol.Feature(new ol.geom.Point(coordinates));
features[i] = new _ol_Feature_(new _ol_geom_Point_(coordinates));
}
var source = new ol.source.Vector({
var source = new _ol_source_Vector_({
features: features
});
var clusterSource = new ol.source.Cluster({
var clusterSource = new _ol_source_Cluster_({
distance: parseInt(distance.value, 10),
source: source
});
var styleCache = {};
var clusters = new ol.layer.Vector({
var clusters = new _ol_layer_Vector_({
source: clusterSource,
style: function(feature) {
var size = feature.get('features').length;
var style = styleCache[size];
if (!style) {
style = new ol.style.Style({
image: new ol.style.Circle({
style = new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 10,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#fff'
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: '#3399CC'
})
}),
text: new ol.style.Text({
text: new _ol_style_Text_({
text: size.toString(),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: '#fff'
})
})
@@ -63,14 +63,14 @@ var clusters = new ol.layer.Vector({
}
});
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, clusters],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,9 +1,9 @@
// NOCOMPILE
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.source.Raster');
goog.require('ol.source.Stamen');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_source_Raster_ from '../src/ol/source/Raster.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
/**
@@ -100,8 +100,8 @@ function xyz2rgb(x) {
12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
}
var raster = new ol.source.Raster({
sources: [new ol.source.Stamen({
var raster = new _ol_source_Raster_({
sources: [new _ol_source_Stamen_({
layer: 'watercolor',
transition: 0
})],
@@ -148,14 +148,14 @@ raster.on('beforeoperations', function(event) {
}
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Image({
new _ol_layer_Image_({
source: raster
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 2500000],
zoom: 2,
maxZoom: 18

View File

@@ -1,10 +1,10 @@
goog.require('ol');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.Control');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_ from '../src/ol.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_Control_ from '../src/ol/control/Control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
/**
@@ -43,13 +43,13 @@ app.RotateNorthControl = function(opt_options) {
element.className = 'rotate-north ol-unselectable ol-control';
element.appendChild(button);
ol.control.Control.call(this, {
_ol_control_Control_.call(this, {
element: element,
target: options.target
});
};
ol.inherits(app.RotateNorthControl, ol.control.Control);
_ol_.inherits(app.RotateNorthControl, _ol_control_Control_);
//
@@ -57,8 +57,8 @@ ol.inherits(app.RotateNorthControl, ol.control.Control);
//
var map = new ol.Map({
controls: ol.control.defaults({
var map = new _ol_Map_({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
@@ -66,12 +66,12 @@ var map = new ol.Map({
new app.RotateNorthControl()
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 3,
rotation: 1

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var logoElement = document.createElement('a');
logoElement.href = 'https://www.osgeo.org/';
@@ -12,14 +12,14 @@ logoImage.src = 'https://www.osgeo.org/sites/all/themes/osgeo/logo.png';
logoElement.appendChild(logoImage);
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
}),

View File

@@ -1,20 +1,20 @@
goog.require('ol');
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.LineString');
goog.require('ol.geom.Point');
goog.require('ol.geom.Polygon');
goog.require('ol.interaction');
goog.require('ol.interaction.Pointer');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.TileJSON');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_ from '../src/ol.js';
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
/**
@@ -29,7 +29,7 @@ var app = {};
*/
app.Drag = function() {
ol.interaction.Pointer.call(this, {
_ol_interaction_Pointer_.call(this, {
handleDownEvent: app.Drag.prototype.handleDownEvent,
handleDragEvent: app.Drag.prototype.handleDragEvent,
handleMoveEvent: app.Drag.prototype.handleMoveEvent,
@@ -61,7 +61,7 @@ app.Drag = function() {
this.previousCursor_ = undefined;
};
ol.inherits(app.Drag, ol.interaction.Pointer);
_ol_.inherits(app.Drag, _ol_interaction_Pointer_);
/**
@@ -134,48 +134,48 @@ app.Drag.prototype.handleUpEvent = function() {
};
var pointFeature = new ol.Feature(new ol.geom.Point([0, 0]));
var pointFeature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
var lineFeature = new ol.Feature(
new ol.geom.LineString([[-1e7, 1e6], [-1e6, 3e6]]));
var lineFeature = new _ol_Feature_(
new _ol_geom_LineString_([[-1e7, 1e6], [-1e6, 3e6]]));
var polygonFeature = new ol.Feature(
new ol.geom.Polygon([[[-3e6, -1e6], [-3e6, 1e6],
var polygonFeature = new _ol_Feature_(
new _ol_geom_Polygon_([[[-3e6, -1e6], [-3e6, 1e6],
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([new app.Drag()]),
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults().extend([new app.Drag()]),
layers: [
new ol.layer.Tile({
source: new ol.source.TileJSON({
new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure'
})
}),
new ol.layer.Vector({
source: new ol.source.Vector({
new _ol_layer_Vector_({
source: new _ol_source_Vector_({
features: [pointFeature, lineFeature, polygonFeature]
}),
style: new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
style: new _ol_style_Style_({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.95,
src: 'data/icon.png'
})),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
width: 3,
color: [255, 0, 0, 1]
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: [0, 0, 255, 0.6]
})
})
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

38
examples/d3.js vendored
View File

@@ -1,25 +1,25 @@
// NOCOMPILE
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.ImageCanvas');
goog.require('ol.source.Stamen');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_extent_ from '../src/ol/extent.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_ImageCanvas_ from '../src/ol/source/ImageCanvas.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.Stamen({
new _ol_layer_Tile_({
source: new _ol_source_Stamen_({
layer: 'watercolor'
})
})
],
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([-97, 38]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([-97, 38]),
zoom: 4
})
});
@@ -57,13 +57,13 @@ d3.json('data/topojson/us.json', function(error, us) {
var pixelBoundsHeight = pixelBounds[1][1] - pixelBounds[0][1];
var geoBounds = d3.geoBounds(features);
var geoBoundsLeftBottom = ol.proj.transform(
var geoBoundsLeftBottom = _ol_proj_.transform(
geoBounds[0], 'EPSG:4326', projection);
var geoBoundsRightTop = ol.proj.transform(
var geoBoundsRightTop = _ol_proj_.transform(
geoBounds[1], 'EPSG:4326', projection);
var geoBoundsWidth = geoBoundsRightTop[0] - geoBoundsLeftBottom[0];
if (geoBoundsWidth < 0) {
geoBoundsWidth += ol.extent.getWidth(projection.getExtent());
geoBoundsWidth += _ol_extent_.getWidth(projection.getExtent());
}
var geoBoundsHeight = geoBoundsRightTop[1] - geoBoundsLeftBottom[1];
@@ -72,7 +72,7 @@ d3.json('data/topojson/us.json', function(error, us) {
var r = Math.max(widthResolution, heightResolution);
var scale = r / (resolution / pixelRatio);
var center = ol.proj.transform(ol.extent.getCenter(extent),
var center = _ol_proj_.transform(_ol_extent_.getCenter(extent),
projection, 'EPSG:4326');
d3Projection.scale(scale).center(center)
.translate([canvasWidth / 2, canvasHeight / 2]);
@@ -83,8 +83,8 @@ d3.json('data/topojson/us.json', function(error, us) {
return canvas.node();
};
var layer = new ol.layer.Image({
source: new ol.source.ImageCanvas({
var layer = new _ol_layer_Image_({
source: new _ol_source_ImageCanvas_({
canvasFunction: canvasFunction,
projection: 'EPSG:3857'
})

View File

@@ -1,27 +1,27 @@
// NOCOMPILE
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.math');
goog.require('ol.proj');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_math_ from '../src/ol/math.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var projection = ol.proj.get('EPSG:3857');
var view = new ol.View({
var projection = _ol_proj_.get('EPSG:3857');
var view = new _ol_View_({
center: [0, 0],
projection: projection,
extent: projection.getExtent(),
zoom: 2
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
@@ -40,9 +40,9 @@ gn.init().then(function() {
gn.start(function(event) {
var center = view.getCenter();
var resolution = view.getResolution();
var alpha = ol.math.toRadians(event.do.beta);
var beta = ol.math.toRadians(event.do.beta);
var gamma = ol.math.toRadians(event.do.gamma);
var alpha = _ol_math_.toRadians(event.do.beta);
var beta = _ol_math_.toRadians(event.do.beta);
var gamma = _ol_math_.toRadians(event.do.gamma);
el('alpha').innerText = alpha + ' [rad]';
el('beta').innerText = beta + ' [rad]';

View File

@@ -1,73 +1,73 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GPX');
goog.require('ol.format.GeoJSON');
goog.require('ol.format.IGC');
goog.require('ol.format.KML');
goog.require('ol.format.TopoJSON');
goog.require('ol.interaction');
goog.require('ol.interaction.DragAndDrop');
goog.require('ol.layer.Vector');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GPX_ from '../src/ol/format/GPX.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_DragAndDrop_ from '../src/ol/interaction/DragAndDrop.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var defaultStyle = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
'Point': new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.5)'
}),
radius: 5,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#ff0',
width: 1
})
})
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'LineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#f00',
width: 3
})
}),
'Polygon': new ol.style.Style({
fill: new ol.style.Fill({
'Polygon': new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(0,255,255,0.5)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#0ff',
width: 1
})
}),
'MultiPoint': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
'MultiPoint': new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(255,0,255,0.5)'
}),
radius: 5,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#f0f',
width: 1
})
})
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'MultiLineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#0f0',
width: 3
})
}),
'MultiPolygon': new ol.style.Style({
fill: new ol.style.Fill({
'MultiPolygon': new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.5)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#00f',
width: 1
})
@@ -83,38 +83,38 @@ var styleFunction = function(feature, resolution) {
}
};
var dragAndDropInteraction = new ol.interaction.DragAndDrop({
var dragAndDropInteraction = new _ol_interaction_DragAndDrop_({
formatConstructors: [
ol.format.GPX,
ol.format.GeoJSON,
ol.format.IGC,
ol.format.KML,
ol.format.TopoJSON
_ol_format_GPX_,
_ol_format_GeoJSON_,
_ol_format_IGC_,
_ol_format_KML_,
_ol_format_TopoJSON_
]
});
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([dragAndDropInteraction]),
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults().extend([dragAndDropInteraction]),
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
})
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
});
dragAndDropInteraction.on('addfeatures', function(event) {
var vectorSource = new ol.source.Vector({
var vectorSource = new _ol_source_Vector_({
features: event.features
});
map.addLayer(new ol.layer.Vector({
map.addLayer(new _ol_layer_Vector_({
renderMode: 'image',
source: vectorSource,
style: styleFunction

View File

@@ -1,73 +1,73 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GPX');
goog.require('ol.format.GeoJSON');
goog.require('ol.format.IGC');
goog.require('ol.format.KML');
goog.require('ol.format.TopoJSON');
goog.require('ol.interaction');
goog.require('ol.interaction.DragAndDrop');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.BingMaps');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GPX_ from '../src/ol/format/GPX.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_DragAndDrop_ from '../src/ol/interaction/DragAndDrop.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var defaultStyle = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
'Point': new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.5)'
}),
radius: 5,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#ff0',
width: 1
})
})
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'LineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#f00',
width: 3
})
}),
'Polygon': new ol.style.Style({
fill: new ol.style.Fill({
'Polygon': new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(0,255,255,0.5)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#0ff',
width: 1
})
}),
'MultiPoint': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
'MultiPoint': new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(255,0,255,0.5)'
}),
radius: 5,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#f0f',
width: 1
})
})
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'MultiLineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#0f0',
width: 3
})
}),
'MultiPolygon': new ol.style.Style({
fill: new ol.style.Fill({
'MultiPolygon': new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.5)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#00f',
width: 1
})
@@ -83,38 +83,38 @@ var styleFunction = function(feature, resolution) {
}
};
var dragAndDropInteraction = new ol.interaction.DragAndDrop({
var dragAndDropInteraction = new _ol_interaction_DragAndDrop_({
formatConstructors: [
ol.format.GPX,
ol.format.GeoJSON,
ol.format.IGC,
ol.format.KML,
ol.format.TopoJSON
_ol_format_GPX_,
_ol_format_GeoJSON_,
_ol_format_IGC_,
_ol_format_KML_,
_ol_format_TopoJSON_
]
});
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([dragAndDropInteraction]),
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults().extend([dragAndDropInteraction]),
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
})
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
});
dragAndDropInteraction.on('addfeatures', function(event) {
var vectorSource = new ol.source.Vector({
var vectorSource = new _ol_source_Vector_({
features: event.features
});
map.addLayer(new ol.layer.Vector({
map.addLayer(new _ol_layer_Vector_({
source: vectorSource,
style: styleFunction
}));

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.DragRotateAndZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_DragRotateAndZoom_ from '../src/ol/interaction/DragRotateAndZoom.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([
new ol.interaction.DragRotateAndZoom()
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults().extend([
new _ol_interaction_DragRotateAndZoom_()
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,63 +1,63 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction.Draw');
goog.require('ol.interaction.Modify');
goog.require('ol.interaction.Snap');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
import _ol_interaction_Snap_ from '../src/ol/interaction/Snap.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var source = new ol.source.Vector();
var vector = new ol.layer.Vector({
var source = new _ol_source_Vector_();
var vector = new _ol_layer_Vector_({
source: source,
style: new ol.style.Style({
fill: new ol.style.Fill({
style: new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#ffcc33',
width: 2
}),
image: new ol.style.Circle({
image: new _ol_style_Circle_({
radius: 7,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: '#ffcc33'
})
})
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-11000000, 4600000],
zoom: 4
})
});
var modify = new ol.interaction.Modify({source: source});
var modify = new _ol_interaction_Modify_({source: source});
map.addInteraction(modify);
var draw, snap; // global so we can remove them later
var typeSelect = document.getElementById('type');
function addInteractions() {
draw = new ol.interaction.Draw({
draw = new _ol_interaction_Draw_({
source: source,
type: typeSelect.value
});
map.addInteraction(draw);
snap = new ol.interaction.Snap({source: source});
snap = new _ol_interaction_Snap_({source: source});
map.addInteraction(snap);
}

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var source = new ol.source.Vector({wrapX: false});
var source = new _ol_source_Vector_({wrapX: false});
var vector = new ol.layer.Vector({
var vector = new _ol_layer_Vector_({
source: source
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-11000000, 4600000],
zoom: 4
})
@@ -31,7 +31,7 @@ var draw; // global so we can remove it later
function addInteraction() {
var value = typeSelect.value;
if (value !== 'None') {
draw = new ol.interaction.Draw({
draw = new _ol_interaction_Draw_({
source: source,
type: typeSelect.value
});

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var source = new ol.source.Vector({wrapX: false});
var source = new _ol_source_Vector_({wrapX: false});
var vector = new ol.layer.Vector({
var vector = new _ol_layer_Vector_({
source: source
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-11000000, 4600000],
zoom: 4
})
@@ -31,7 +31,7 @@ var draw; // global so we can remove it later
function addInteraction() {
var value = typeSelect.value;
if (value !== 'None') {
draw = new ol.interaction.Draw({
draw = new _ol_interaction_Draw_({
source: source,
type: typeSelect.value,
freehand: true

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Polygon');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var source = new ol.source.Vector({wrapX: false});
var source = new _ol_source_Vector_({wrapX: false});
var vector = new ol.layer.Vector({
var vector = new _ol_layer_Vector_({
source: source
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-11000000, 4600000],
zoom: 4
})
@@ -35,15 +35,15 @@ function addInteraction() {
var geometryFunction;
if (value === 'Square') {
value = 'Circle';
geometryFunction = ol.interaction.Draw.createRegularPolygon(4);
geometryFunction = _ol_interaction_Draw_.createRegularPolygon(4);
} else if (value === 'Box') {
value = 'Circle';
geometryFunction = ol.interaction.Draw.createBox();
geometryFunction = _ol_interaction_Draw_.createBox();
} else if (value === 'Star') {
value = 'Circle';
geometryFunction = function(coordinates, geometry) {
if (!geometry) {
geometry = new ol.geom.Polygon(null);
geometry = new _ol_geom_Polygon_(null);
}
var center = coordinates[0];
var last = coordinates[1];
@@ -65,7 +65,7 @@ function addInteraction() {
return geometry;
};
}
draw = new ol.interaction.Draw({
draw = new _ol_interaction_Draw_({
source: source,
type: value,
geometryFunction: geometryFunction

View File

@@ -1,50 +1,50 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_MultiPoint_ from '../src/ol/geom/MultiPoint.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
});
var imageStyle = new ol.style.Style({
image: new ol.style.Circle({
var imageStyle = new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 5,
snapToPixel: false,
fill: new ol.style.Fill({color: 'yellow'}),
stroke: new ol.style.Stroke({color: 'red', width: 1})
fill: new _ol_style_Fill_({color: 'yellow'}),
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
})
});
var headInnerImageStyle = new ol.style.Style({
image: new ol.style.Circle({
var headInnerImageStyle = new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 2,
snapToPixel: false,
fill: new ol.style.Fill({color: 'blue'})
fill: new _ol_style_Fill_({color: 'blue'})
})
});
var headOuterImageStyle = new ol.style.Style({
image: new ol.style.Circle({
var headOuterImageStyle = new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 5,
snapToPixel: false,
fill: new ol.style.Fill({color: 'black'})
fill: new _ol_style_Fill_({color: 'black'})
})
});
@@ -66,9 +66,9 @@ map.on('postcompose', function(event) {
coordinates.push([x, y]);
}
vectorContext.setStyle(imageStyle);
vectorContext.drawGeometry(new ol.geom.MultiPoint(coordinates));
vectorContext.drawGeometry(new _ol_geom_MultiPoint_(coordinates));
var headPoint = new ol.geom.Point(coordinates[coordinates.length - 1]);
var headPoint = new _ol_geom_Point_(coordinates[coordinates.length - 1]);
vectorContext.setStyle(headOuterImageStyle);
vectorContext.drawGeometry(headPoint);

View File

@@ -1,37 +1,37 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.format.KML');
goog.require('ol.interaction');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Cluster');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.RegularShape');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
goog.require('ol.style.Text');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_extent_ from '../src/ol/extent.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Cluster_ from '../src/ol/source/Cluster.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js';
var earthquakeFill = new ol.style.Fill({
var earthquakeFill = new _ol_style_Fill_({
color: 'rgba(255, 153, 0, 0.8)'
});
var earthquakeStroke = new ol.style.Stroke({
var earthquakeStroke = new _ol_style_Stroke_({
color: 'rgba(255, 204, 0, 0.2)',
width: 1
});
var textFill = new ol.style.Fill({
var textFill = new _ol_style_Fill_({
color: '#fff'
});
var textStroke = new ol.style.Stroke({
var textStroke = new _ol_style_Stroke_({
color: 'rgba(0, 0, 0, 0.6)',
width: 3
});
var invisibleFill = new ol.style.Fill({
var invisibleFill = new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.01)'
});
@@ -43,9 +43,9 @@ function createEarthquakeStyle(feature) {
var magnitude = parseFloat(name.substr(2));
var radius = 5 + 20 * (magnitude - 5);
return new ol.style.Style({
return new _ol_style_Style_({
geometry: feature.getGeometry(),
image: new ol.style.RegularShape({
image: new _ol_style_RegularShape_({
radius1: radius,
radius2: 3,
points: 5,
@@ -64,13 +64,13 @@ function calculateClusterInfo(resolution) {
for (var i = features.length - 1; i >= 0; --i) {
feature = features[i];
var originalFeatures = feature.get('features');
var extent = ol.extent.createEmpty();
var extent = _ol_extent_.createEmpty();
var j, jj;
for (j = 0, jj = originalFeatures.length; j < jj; ++j) {
ol.extent.extend(extent, originalFeatures[j].getGeometry().getExtent());
_ol_extent_.extend(extent, originalFeatures[j].getGeometry().getExtent());
}
maxFeatureCount = Math.max(maxFeatureCount, jj);
radius = 0.25 * (ol.extent.getWidth(extent) + ol.extent.getHeight(extent)) /
radius = 0.25 * (_ol_extent_.getWidth(extent) + _ol_extent_.getHeight(extent)) /
resolution;
feature.set('radius', radius);
}
@@ -85,14 +85,14 @@ function styleFunction(feature, resolution) {
var style;
var size = feature.get('features').length;
if (size > 1) {
style = new ol.style.Style({
image: new ol.style.Circle({
style = new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: feature.get('radius'),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: [255, 153, 0, Math.min(0.8, 0.4 + (size / maxFeatureCount))]
})
}),
text: new ol.style.Text({
text: new _ol_style_Text_({
text: size.toString(),
fill: textFill,
stroke: textStroke
@@ -106,8 +106,8 @@ function styleFunction(feature, resolution) {
}
function selectStyleFunction(feature) {
var styles = [new ol.style.Style({
image: new ol.style.Circle({
var styles = [new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: feature.get('radius'),
fill: invisibleFill
})
@@ -121,12 +121,12 @@ function selectStyleFunction(feature) {
return styles;
}
vector = new ol.layer.Vector({
source: new ol.source.Cluster({
vector = new _ol_layer_Vector_({
source: new _ol_source_Cluster_({
distance: 40,
source: new ol.source.Vector({
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({
format: new _ol_format_KML_({
extractStyles: false
})
})
@@ -134,15 +134,15 @@ vector = new ol.layer.Vector({
style: styleFunction
});
var raster = new ol.layer.Tile({
source: new ol.source.Stamen({
var raster = new _ol_layer_Tile_({
source: new _ol_source_Stamen_({
layer: 'toner'
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
interactions: ol.interaction.defaults().extend([new ol.interaction.Select({
interactions: _ol_interaction_.defaults().extend([new _ol_interaction_Select_({
condition: function(evt) {
return evt.type == 'pointermove' ||
evt.type == 'singleclick';
@@ -150,7 +150,7 @@ var map = new ol.Map({
style: selectStyleFunction
})]),
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,16 +1,16 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.KML');
goog.require('ol.geom.Polygon');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.render');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_render_ from '../src/ol/render.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
@@ -32,16 +32,16 @@ var styleFunction = function(feature) {
if (!style) {
var canvas =
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
var vectorContext = ol.render.toContext(
var vectorContext = _ol_render_.toContext(
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
{size: [size, size], pixelRatio: 1});
vectorContext.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2})
vectorContext.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: 'rgba(255, 153, 0, 0.4)'}),
stroke: new _ol_style_Stroke_({color: 'rgba(255, 204, 0, 0.2)', width: 2})
}));
vectorContext.drawGeometry(new ol.geom.Polygon([symbol.map(scaleFunction)]));
style = new ol.style.Style({
image: new ol.style.Icon({
vectorContext.drawGeometry(new _ol_geom_Polygon_([symbol.map(scaleFunction)]));
style = new _ol_style_Style_({
image: new _ol_style_Icon_({
img: canvas,
imgSize: [size, size],
rotation: 1.2
@@ -52,26 +52,26 @@ var styleFunction = function(feature) {
return style;
};
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({
format: new _ol_format_KML_({
extractStyles: false
})
}),
style: styleFunction
});
var raster = new ol.layer.Tile({
source: new ol.source.Stamen({
var raster = new _ol_layer_Tile_({
source: new _ol_source_Stamen_({
layer: 'toner'
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,14 +1,14 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.ScaleLine');
goog.require('ol.layer.Tile');
goog.require('ol.source.TileWMS');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_ScaleLine_ from '../src/ol/control/ScaleLine.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js';
var layers = [
new ol.layer.Tile({
source: new ol.source.TileWMS({
new _ol_layer_Tile_({
source: new _ol_source_TileWMS_({
url: 'https://ahocevar.com/geoserver/wms',
params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
@@ -18,15 +18,15 @@ var layers = [
})
];
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.ScaleLine({
var map = new _ol_Map_({
controls: _ol_control_.defaults().extend([
new _ol_control_ScaleLine_({
units: 'degrees'
})
]),
layers: layers,
target: 'map',
view: new ol.View({
view: new _ol_View_({
projection: 'EPSG:4326',
center: [0, 0],
zoom: 2

View File

@@ -1,33 +1,33 @@
// NOCOMPILE
// this example uses FileSaver.js for which we don't have an externs file.
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
new ol.layer.Vector({
source: new ol.source.Vector({
new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON()
format: new _ol_format_GeoJSON_()
})
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,40 +1,40 @@
// NOCOMPILE
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.format.WKT');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_format_WKT_ from '../src/ol/format/WKT.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var format = new ol.format.WKT();
var format = new _ol_format_WKT_();
var feature = format.readFeature(
'POLYGON((10.689697265625 -25.0927734375, 34.595947265625 ' +
'-20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 ' +
'-39.1552734375, 10.689697265625 -25.0927734375))');
feature.getGeometry().transform('EPSG:4326', 'EPSG:3857');
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
features: [feature]
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,36 +1,36 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.events.condition');
goog.require('ol.format.GeoJSON');
goog.require('ol.interaction.Extent');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_events_condition_ from '../src/ol/events/condition.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_interaction_Extent_ from '../src/ol/interaction/Extent.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var vectorSource = new ol.source.Vector({
var vectorSource = new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON()
format: new _ol_format_GeoJSON_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
new ol.layer.Vector({
new _ol_layer_Vector_({
source: vectorSource
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
});
var extent = new ol.interaction.Extent({
condition: ol.events.condition.platformModifierKeyOnly
var extent = new _ol_interaction_Extent_({
condition: _ol_events_condition_.platformModifierKeyOnly
});
map.addInteraction(extent);
extent.setActive(false);

View File

@@ -1,44 +1,44 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.Observable');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.easing');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_Observable_ from '../src/ol/Observable.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_easing_ from '../src/ol/easing.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM({
new _ol_layer_Tile_({
source: new _ol_source_OSM_({
wrapX: false
})
})
],
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 1
})
});
var source = new ol.source.Vector({
var source = new _ol_source_Vector_({
wrapX: false
});
var vector = new ol.layer.Vector({
var vector = new _ol_layer_Vector_({
source: source
});
map.addLayer(vector);
@@ -46,9 +46,9 @@ map.addLayer(vector);
function addRandomFeature() {
var x = Math.random() * 360 - 180;
var y = Math.random() * 180 - 90;
var geom = new ol.geom.Point(ol.proj.transform([x, y],
var geom = new _ol_geom_Point_(_ol_proj_.transform([x, y],
'EPSG:4326', 'EPSG:3857'));
var feature = new ol.Feature(geom);
var feature = new _ol_Feature_(geom);
source.addFeature(feature);
}
@@ -64,14 +64,14 @@ function flash(feature) {
var elapsed = frameState.time - start;
var elapsedRatio = elapsed / duration;
// radius will be 5 at start and 30 at end.
var radius = ol.easing.easeOut(elapsedRatio) * 25 + 5;
var opacity = ol.easing.easeOut(1 - elapsedRatio);
var radius = _ol_easing_.easeOut(elapsedRatio) * 25 + 5;
var opacity = _ol_easing_.easeOut(1 - elapsedRatio);
var style = new ol.style.Style({
image: new ol.style.Circle({
var style = new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: radius,
snapToPixel: false,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'rgba(255, 0, 0, ' + opacity + ')',
width: 0.25 + opacity
})
@@ -81,7 +81,7 @@ function flash(feature) {
vectorContext.setStyle(style);
vectorContext.drawGeometry(flashGeom);
if (elapsed > duration) {
ol.Observable.unByKey(listenerKey);
_ol_Observable_.unByKey(listenerKey);
return;
}
// tell OpenLayers to continue postcompose animation

View File

@@ -1,17 +1,17 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.Polyline');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.BingMaps');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_Polyline_ from '../src/ol/format/Polyline.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
// This long string is placed here due to jsFiddle limitations.
// It is usually loaded with AJAX.
@@ -57,7 +57,7 @@ var polyline = [
'~@ym@yjA??a@cFd@kBrCgDbAUnAcBhAyAdk@et@??kF}D??OL'
].join('');
var route = /** @type {ol.geom.LineString} */ (new ol.format.Polyline({
var route = /** @type {ol.geom.LineString} */ (new _ol_format_Polyline_({
factor: 1e6
}).readGeometry(polyline, {
dataProjection: 'EPSG:4326',
@@ -67,41 +67,41 @@ var route = /** @type {ol.geom.LineString} */ (new ol.format.Polyline({
var routeCoords = route.getCoordinates();
var routeLength = routeCoords.length;
var routeFeature = new ol.Feature({
var routeFeature = new _ol_Feature_({
type: 'route',
geometry: route
});
var geoMarker = new ol.Feature({
var geoMarker = new _ol_Feature_({
type: 'geoMarker',
geometry: new ol.geom.Point(routeCoords[0])
geometry: new _ol_geom_Point_(routeCoords[0])
});
var startMarker = new ol.Feature({
var startMarker = new _ol_Feature_({
type: 'icon',
geometry: new ol.geom.Point(routeCoords[0])
geometry: new _ol_geom_Point_(routeCoords[0])
});
var endMarker = new ol.Feature({
var endMarker = new _ol_Feature_({
type: 'icon',
geometry: new ol.geom.Point(routeCoords[routeLength - 1])
geometry: new _ol_geom_Point_(routeCoords[routeLength - 1])
});
var styles = {
'route': new ol.style.Style({
stroke: new ol.style.Stroke({
'route': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
width: 6, color: [237, 212, 0, 0.8]
})
}),
'icon': new ol.style.Style({
image: new ol.style.Icon({
'icon': new _ol_style_Style_({
image: new _ol_style_Icon_({
anchor: [0.5, 1],
src: 'data/icon.png'
})
}),
'geoMarker': new ol.style.Style({
image: new ol.style.Circle({
'geoMarker': new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 7,
snapToPixel: false,
fill: new ol.style.Fill({color: 'black'}),
stroke: new ol.style.Stroke({
fill: new _ol_style_Fill_({color: 'black'}),
stroke: new _ol_style_Stroke_({
color: 'white', width: 2
})
})
@@ -113,8 +113,8 @@ var speed, now;
var speedInput = document.getElementById('speed');
var startButton = document.getElementById('start-animation');
var vectorLayer = new ol.layer.Vector({
source: new ol.source.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
features: [routeFeature, geoMarker, startMarker, endMarker]
}),
style: function(feature) {
@@ -127,18 +127,18 @@ var vectorLayer = new ol.layer.Vector({
});
var center = [-5639523.95, -3501274.52];
var map = new ol.Map({
var map = new _ol_Map_({
target: document.getElementById('map'),
loadTilesWhileAnimating: true,
view: new ol.View({
view: new _ol_View_({
center: center,
zoom: 10,
minZoom: 2,
maxZoom: 19
}),
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
imagerySet: 'AerialWithLabels',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
})
@@ -162,8 +162,8 @@ var moveFeature = function(event) {
return;
}
var currentPoint = new ol.geom.Point(routeCoords[index]);
var feature = new ol.Feature(currentPoint);
var currentPoint = new _ol_geom_Point_(routeCoords[index]);
var feature = new _ol_Feature_(currentPoint);
vectorContext.drawFeature(feature, styles.geoMarker);
}
// tell OpenLayers to continue the postcompose animation

View File

@@ -1,33 +1,33 @@
// NOCOMPILE
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.LineString');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.Stamen({
new _ol_layer_Tile_({
source: new _ol_source_Stamen_({
layer: 'toner'
})
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
});
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
var style = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#EAE911',
width: 2
})
@@ -61,7 +61,7 @@ var animateFlights = function(event) {
}
var maxIndex = Math.min(elapsedPoints, coords.length);
var currentLine = new ol.geom.LineString(coords.slice(0, maxIndex));
var currentLine = new _ol_geom_LineString_(coords.slice(0, maxIndex));
// directly draw the line with the vector context
vectorContext.drawGeometry(currentLine);
@@ -71,7 +71,7 @@ var animateFlights = function(event) {
map.render();
};
flightsSource = new ol.source.Vector({
flightsSource = new _ol_source_Vector_({
wrapX: false,
attributions: 'Flight data by ' +
'<a href="http://openflights.org/data.html">OpenFlights</a>,',
@@ -93,10 +93,10 @@ flightsSource = new ol.source.Vector({
var arcLine = arcGenerator.Arc(100, {offset: 10});
if (arcLine.geometries.length === 1) {
var line = new ol.geom.LineString(arcLine.geometries[0].coords);
line.transform(ol.proj.get('EPSG:4326'), ol.proj.get('EPSG:3857'));
var line = new _ol_geom_LineString_(arcLine.geometries[0].coords);
line.transform(_ol_proj_.get('EPSG:4326'), _ol_proj_.get('EPSG:3857'));
var feature = new ol.Feature({
var feature = new _ol_Feature_({
geometry: line,
finished: false
});
@@ -110,7 +110,7 @@ flightsSource = new ol.source.Vector({
}
});
var flightsLayer = new ol.layer.Vector({
var flightsLayer = new _ol_layer_Vector_({
source: flightsSource,
style: function(feature) {
// if the animation is still active for a feature, do not

View File

@@ -1,9 +1,9 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.LineString');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var radius = 10e6;
var cos30 = Math.cos(Math.PI / 6);
@@ -11,22 +11,22 @@ var sin30 = Math.sin(Math.PI / 6);
var rise = radius * sin30;
var run = radius * cos30;
var triangle = new ol.geom.LineString([
var triangle = new _ol_geom_LineString_([
[0, radius], [run, -rise], [-run, -rise], [0, radius]
]);
var feature = new ol.Feature(triangle);
var feature = new _ol_Feature_(triangle);
var layer = new ol.layer.Vector({
source: new ol.source.Vector({
var layer = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
features: [feature]
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [layer],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 1
})

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.FullScreen');
goog.require('ol.interaction');
goog.require('ol.interaction.DragRotateAndZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_FullScreen_ from '../src/ol/control/FullScreen.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_DragRotateAndZoom_ from '../src/ol/interaction/DragRotateAndZoom.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.FullScreen()
var map = new _ol_Map_({
controls: _ol_control_.defaults().extend([
new _ol_control_FullScreen_()
]),
interactions: ol.interaction.defaults().extend([
new ol.interaction.DragRotateAndZoom()
interactions: _ol_interaction_.defaults().extend([
new _ol_interaction_DragRotateAndZoom_()
]),
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial'
})
@@ -25,7 +25,7 @@ var map = new ol.Map({
],
// Use the canvas renderer because it's currently the fastest
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-33519607, 5616436],
rotation: -Math.PI / 8,
zoom: 8

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.FullScreen');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_FullScreen_ from '../src/ol/control/FullScreen.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var view = new ol.View({
var view = new _ol_View_({
center: [-9101767, 2822912],
zoom: 14
});
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.FullScreen({
var map = new _ol_Map_({
controls: _ol_control_.defaults().extend([
new _ol_control_FullScreen_({
source: 'fullscreen'
})
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.FullScreen');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_FullScreen_ from '../src/ol/control/FullScreen.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var view = new ol.View({
var view = new _ol_View_({
center: [-9101767, 2822912],
zoom: 14
});
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.FullScreen()
var map = new _ol_Map_({
controls: _ol_control_.defaults().extend([
new _ol_control_FullScreen_()
]),
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial'
})

View File

@@ -1,12 +1,12 @@
// NOCOMPILE
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.source.OSM');
goog.require('ol.source.VectorTile');
goog.require('ol.layer.Tile');
goog.require('ol.layer.VectorTile');
goog.require('ol.proj.Projection');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
var replacer = function(key, value) {
@@ -48,19 +48,19 @@ var replacer = function(key, value) {
}
};
var tilePixels = new ol.proj.Projection({
var tilePixels = new _ol_proj_Projection_({
code: 'TILE_PIXELS',
units: 'tile-pixels'
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
@@ -74,8 +74,8 @@ fetch(url).then(function(response) {
extent: 4096,
debug: 1
});
var vectorSource = new ol.source.VectorTile({
format: new ol.format.GeoJSON(),
var vectorSource = new _ol_source_VectorTile_({
format: new _ol_format_GeoJSON_(),
tileLoadFunction: function(tile) {
var format = tile.getFormat();
var tileCoord = tile.getTileCoord();
@@ -93,7 +93,7 @@ fetch(url).then(function(response) {
},
url: 'data:' // arbitrary url, we don't use it in the tileLoadFunction
});
var vectorLayer = new ol.layer.VectorTile({
var vectorLayer = new _ol_layer_VectorTile_({
source: vectorSource
});
map.addLayer(vectorLayer);

View File

@@ -1,85 +1,85 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.format.GeoJSON');
goog.require('ol.geom.Circle');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_geom_Circle_ from '../src/ol/geom/Circle.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var image = new ol.style.Circle({
var image = new _ol_style_Circle_({
radius: 5,
fill: null,
stroke: new ol.style.Stroke({color: 'red', width: 1})
stroke: new _ol_style_Stroke_({color: 'red', width: 1})
});
var styles = {
'Point': new ol.style.Style({
'Point': new _ol_style_Style_({
image: image
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'LineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'green',
width: 1
})
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'MultiLineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'green',
width: 1
})
}),
'MultiPoint': new ol.style.Style({
'MultiPoint': new _ol_style_Style_({
image: image
}),
'MultiPolygon': new ol.style.Style({
stroke: new ol.style.Stroke({
'MultiPolygon': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'yellow',
width: 1
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 0, 0.1)'
})
}),
'Polygon': new ol.style.Style({
stroke: new ol.style.Stroke({
'Polygon': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'blue',
lineDash: [4],
width: 3
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(0, 0, 255, 0.1)'
})
}),
'GeometryCollection': new ol.style.Style({
stroke: new ol.style.Stroke({
'GeometryCollection': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'magenta',
width: 2
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'magenta'
}),
image: new ol.style.Circle({
image: new _ol_style_Circle_({
radius: 10,
fill: null,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'magenta'
})
})
}),
'Circle': new ol.style.Style({
stroke: new ol.style.Stroke({
'Circle': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'red',
width: 2
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.2)'
})
})
@@ -160,31 +160,31 @@ var geojsonObject = {
}]
};
var vectorSource = new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures(geojsonObject)
var vectorSource = new _ol_source_Vector_({
features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
});
vectorSource.addFeature(new ol.Feature(new ol.geom.Circle([5e6, 7e6], 1e6)));
vectorSource.addFeature(new _ol_Feature_(new _ol_geom_Circle_([5e6, 7e6], 1e6)));
var vectorLayer = new ol.layer.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: vectorSource,
style: styleFunction
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}),
vectorLayer
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,28 +1,28 @@
goog.require('ol.Geolocation');
goog.require('ol.Map');
goog.require('ol.Overlay');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.geom.LineString');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
import _ol_Geolocation_ from '../src/ol/Geolocation.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
// creating the view
var view = new ol.View({
center: ol.proj.fromLonLat([5.8713, 45.6452]),
var view = new _ol_View_({
center: _ol_proj_.fromLonLat([5.8713, 45.6452]),
zoom: 19
});
// creating the map
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
@@ -32,7 +32,7 @@ var map = new ol.Map({
// Geolocation marker
var markerEl = document.getElementById('geolocation_marker');
var marker = new ol.Overlay({
var marker = new _ol_Overlay_({
positioning: 'center-center',
element: markerEl,
stopEvent: false
@@ -42,11 +42,11 @@ map.addOverlay(marker);
// LineString to store the different geolocation positions. This LineString
// is time aware.
// The Z dimension is actually used to store the rotation (heading).
var positions = new ol.geom.LineString([],
var positions = new _ol_geom_LineString_([],
/** @type {ol.geom.GeometryLayout} */ ('XYZM'));
// Geolocation Control
var geolocation = new ol.Geolocation({
var geolocation = new _ol_Geolocation_({
projection: view.getProjection(),
trackingOptions: {
maximumAge: 10000,
@@ -215,7 +215,7 @@ function simulatePositionChange(position) {
geolocation.set('accuracy', coords.accuracy);
geolocation.set('heading', degToRad(coords.heading));
var position_ = [coords.longitude, coords.latitude];
var projectedPosition = ol.proj.transform(position_, 'EPSG:4326',
var projectedPosition = _ol_proj_.transform(position_, 'EPSG:4326',
'EPSG:3857');
geolocation.set('position', projectedPosition);
geolocation.set('speed', coords.speed);

View File

@@ -1,31 +1,31 @@
goog.require('ol.Feature');
goog.require('ol.Geolocation');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Geolocation_ from '../src/ol/Geolocation.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var view = new ol.View({
var view = new _ol_View_({
center: [0, 0],
zoom: 2
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
@@ -33,7 +33,7 @@ var map = new ol.Map({
view: view
});
var geolocation = new ol.Geolocation({
var geolocation = new _ol_Geolocation_({
projection: view.getProjection()
});
@@ -61,19 +61,19 @@ geolocation.on('error', function(error) {
info.style.display = '';
});
var accuracyFeature = new ol.Feature();
var accuracyFeature = new _ol_Feature_();
geolocation.on('change:accuracyGeometry', function() {
accuracyFeature.setGeometry(geolocation.getAccuracyGeometry());
});
var positionFeature = new ol.Feature();
positionFeature.setStyle(new ol.style.Style({
image: new ol.style.Circle({
var positionFeature = new _ol_Feature_();
positionFeature.setStyle(new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 6,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: '#3399CC'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#fff',
width: 2
})
@@ -83,12 +83,12 @@ positionFeature.setStyle(new ol.style.Style({
geolocation.on('change:position', function() {
var coordinates = geolocation.getPosition();
positionFeature.setGeometry(coordinates ?
new ol.geom.Point(coordinates) : null);
new _ol_geom_Point_(coordinates) : null);
});
new ol.layer.Vector({
new _ol_layer_Vector_({
map: map,
source: new ol.source.Vector({
source: new _ol_source_Vector_({
features: [accuracyFeature, positionFeature]
})
});

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.source.ImageWMS');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_source_ImageWMS_ from '../src/ol/source/ImageWMS.js';
var wmsSource = new ol.source.ImageWMS({
var wmsSource = new _ol_source_ImageWMS_({
url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'},
serverType: 'geoserver',
crossOrigin: 'anonymous'
});
var wmsLayer = new ol.layer.Image({
var wmsLayer = new _ol_layer_Image_({
source: wmsSource
});
var view = new ol.View({
var view = new _ol_View_({
center: [0, 0],
zoom: 1
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [wmsLayer],
target: 'map',
view: view

View File

@@ -1,21 +1,21 @@
goog.require('ol.format.WMSGetFeatureInfo');
import _ol_format_WMSGetFeatureInfo_ from '../src/ol/format/WMSGetFeatureInfo.js';
fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) {
return response.text();
}).then(function(response) {
// this is the standard way to read the features
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
var allFeatures = new _ol_format_WMSGetFeatureInfo_().readFeatures(response);
document.getElementById('all').innerText = allFeatures.length.toString();
// when specifying the 'layers' options, only the features of those
// layers are returned by the format
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
var hotelFeatures = new _ol_format_WMSGetFeatureInfo_({
layers: ['hotel']
}).readFeatures(response);
document.getElementById('hotel').innerText = hotelFeatures.length.toString();
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
var restaurantFeatures = new _ol_format_WMSGetFeatureInfo_({
layers: ['restaurant']
}).readFeatures(response);
document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.TileWMS');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js';
var wmsSource = new ol.source.TileWMS({
var wmsSource = new _ol_source_TileWMS_({
url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'ne:ne', 'TILED': true},
serverType: 'geoserver',
crossOrigin: 'anonymous'
});
var wmsLayer = new ol.layer.Tile({
var wmsLayer = new _ol_layer_Tile_({
source: wmsSource
});
var view = new ol.View({
var view = new _ol_View_({
center: [0, 0],
zoom: 1
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [wmsLayer],
target: 'map',
view: view

View File

@@ -1,63 +1,63 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GPX');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.BingMaps');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GPX_ from '../src/ol/format/GPX.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({
source: new ol.source.BingMaps({
var raster = new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
})
});
var style = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
'Point': new _ol_style_Style_({
image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.4)'
}),
radius: 5,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#ff0',
width: 1
})
})
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'LineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#f00',
width: 3
})
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
'MultiLineString': new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#0f0',
width: 3
})
})
};
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/gpx/fells_loop.gpx',
format: new ol.format.GPX()
format: new _ol_format_GPX_()
}),
style: function(feature) {
return style[feature.getGeometry().getType()];
}
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: document.getElementById('map'),
view: new ol.View({
view: new _ol_View_({
center: [-7916041.528716288, 5228379.045749711],
zoom: 12
})

View File

@@ -1,32 +1,32 @@
goog.require('ol.Graticule');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.style.Stroke');
import _ol_Graticule_ from '../src/ol/Graticule.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM({
new _ol_layer_Tile_({
source: new _ol_source_OSM_({
wrapX: false
})
})
],
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([4.8, 47.75]),
extent: ol.proj.get('EPSG:3857').getExtent(),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([4.8, 47.75]),
extent: _ol_proj_.get('EPSG:3857').getExtent(),
zoom: 5
})
});
// Create the graticule component
var graticule = new ol.Graticule({
var graticule = new _ol_Graticule_({
// the style to use for the lines, optional.
strokeStyle: new ol.style.Stroke({
strokeStyle: new _ol_style_Stroke_({
color: 'rgba(255,120,0,0.9)',
width: 2,
lineDash: [0.5, 4]

View File

@@ -1,18 +1,18 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.KML');
goog.require('ol.layer.Heatmap');
goog.require('ol.layer.Tile');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_layer_Heatmap_ from '../src/ol/layer/Heatmap.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var blur = document.getElementById('blur');
var radius = document.getElementById('radius');
var vector = new ol.layer.Heatmap({
source: new ol.source.Vector({
var vector = new _ol_layer_Heatmap_({
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({
format: new _ol_format_KML_({
extractStyles: false
})
}),
@@ -29,16 +29,16 @@ vector.getSource().on('addfeature', function(event) {
event.feature.set('weight', magnitude - 5);
});
var raster = new ol.layer.Tile({
source: new ol.source.Stamen({
var raster = new _ol_layer_Tile_({
source: new _ol_source_Stamen_({
layer: 'toner'
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.XYZ');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_XYZ_ from '../src/ol/source/XYZ.js';
var appId = 'kDm0Jq1K4Ak7Bwtn8uvk';
var appCode = 'xnmvc4dKZrDfGlvQHXSvwQ';
@@ -56,10 +56,10 @@ var layers = [];
var i, ii;
for (i = 0, ii = hereLayers.length; i < ii; ++i) {
var layerDesc = hereLayers[i];
layers.push(new ol.layer.Tile({
layers.push(new _ol_layer_Tile_({
visible: false,
preload: Infinity,
source: new ol.source.XYZ({
source: new _ol_source_XYZ_({
url: createUrl(urlTpl, layerDesc),
attributions: 'Map Tiles &copy; ' + new Date().getFullYear() + ' ' +
'<a href="http://developer.here.com">HERE</a>'
@@ -67,13 +67,13 @@ for (i = 0, ii = hereLayers.length; i < ii; ++i) {
}));
}
var map = new ol.Map({
var map = new _ol_Map_({
layers: layers,
// Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true,
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [921371.9389, 6358337.7609],
zoom: 10
})

View File

@@ -1,38 +1,38 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.Feature');
goog.require('ol.geom.LineString');
goog.require('ol.style.Style');
goog.require('ol.style.Stroke');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
var style = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'black',
width: 1
})
});
var feature = new ol.Feature(new ol.geom.LineString([[-4000000, 0], [4000000, 0]]));
var feature = new _ol_Feature_(new _ol_geom_LineString_([[-4000000, 0], [4000000, 0]]));
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
features: [feature]
}),
style: style
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,46 +1,46 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.TileJSON');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var rome = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([12.5, 41.9]))
var rome = new _ol_Feature_({
geometry: new _ol_geom_Point_(_ol_proj_.fromLonLat([12.5, 41.9]))
});
var london = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([-0.12755, 51.507222]))
var london = new _ol_Feature_({
geometry: new _ol_geom_Point_(_ol_proj_.fromLonLat([-0.12755, 51.507222]))
});
var madrid = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([-3.683333, 40.4]))
var madrid = new _ol_Feature_({
geometry: new _ol_geom_Point_(_ol_proj_.fromLonLat([-3.683333, 40.4]))
});
rome.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
rome.setStyle(new _ol_style_Style_({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: '#8959A8',
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
}));
london.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
london.setStyle(new _ol_style_Style_({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: '#4271AE',
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
}));
madrid.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
madrid.setStyle(new _ol_style_Style_({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: [113, 140, 0],
crossOrigin: 'anonymous',
src: 'data/dot.png'
@@ -48,26 +48,26 @@ madrid.setStyle(new ol.style.Style({
}));
var vectorSource = new ol.source.Vector({
var vectorSource = new _ol_source_Vector_({
features: [rome, london, madrid]
});
var vectorLayer = new ol.layer.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: vectorSource
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.TileJSON({
var rasterLayer = new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
crossOrigin: ''
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [rasterLayer, vectorLayer],
target: document.getElementById('map'),
view: new ol.View({
center: ol.proj.fromLonLat([2.896372, 44.60240]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([2.896372, 44.60240]),
zoom: 3
})
});

View File

@@ -1,19 +1,19 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
function createStyle(src, img) {
return new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
return new _ol_style_Style_({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 0.96],
crossOrigin: 'anonymous',
src: src,
@@ -23,30 +23,30 @@ function createStyle(src, img) {
});
}
var iconFeature = new ol.Feature(new ol.geom.Point([0, 0]));
var iconFeature = new _ol_Feature_(new _ol_geom_Point_([0, 0]));
iconFeature.set('style', createStyle('data/icon.png', undefined));
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.Stamen({layer: 'watercolor'})
new _ol_layer_Tile_({
source: new _ol_source_Stamen_({layer: 'watercolor'})
}),
new ol.layer.Vector({
new _ol_layer_Vector_({
style: function(feature) {
return feature.get('style');
},
source: new ol.source.Vector({features: [iconFeature]})
source: new _ol_source_Vector_({features: [iconFeature]})
})
],
target: document.getElementById('map'),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 3
})
});
var selectStyle = {};
var select = new ol.interaction.Select({
var select = new _ol_interaction_Select_({
style: function(feature) {
var image = feature.get('style').getImage().getImage();
if (!selectStyle[image.src]) {

View File

@@ -1,11 +1,11 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var iconInfo = [{
@@ -44,7 +44,7 @@ var iconCount = iconInfo.length;
var icons = new Array(iconCount);
for (i = 0; i < iconCount; ++i) {
var info = iconInfo[i];
icons[i] = new ol.style.Icon({
icons[i] = new _ol_style_Icon_({
offset: info.offset,
opacity: info.opacity,
rotateWithView: info.rotateWithView,
@@ -61,29 +61,29 @@ var features = new Array(featureCount);
var feature, geometry;
var e = 25000000;
for (i = 0; i < featureCount; ++i) {
geometry = new ol.geom.Point(
geometry = new _ol_geom_Point_(
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
feature = new ol.Feature(geometry);
feature = new _ol_Feature_(geometry);
feature.setStyle(
new ol.style.Style({
new _ol_style_Style_({
image: icons[i % (iconCount - 1)]
})
);
features[i] = feature;
}
var vectorSource = new ol.source.Vector({
var vectorSource = new _ol_source_Vector_({
features: features
});
var vector = new ol.layer.Vector({
var vector = new _ol_layer_Vector_({
source: vectorSource
});
var map = new ol.Map({
var map = new _ol_Map_({
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
layers: [vector],
target: document.getElementById('map'),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 5
})
@@ -96,12 +96,12 @@ for (i = 0; i < featureCount; i += 30) {
overlayFeatures.push(clone);
}
new ol.layer.Vector({
new _ol_layer_Vector_({
map: map,
source: new ol.source.Vector({
source: new _ol_source_Vector_({
features: overlayFeatures
}),
style: new ol.style.Style({
style: new _ol_style_Style_({
image: icons[iconCount - 1]
})
});

View File

@@ -1,25 +1,25 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.Overlay');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.TileJSON');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var iconFeature = new ol.Feature({
geometry: new ol.geom.Point([0, 0]),
var iconFeature = new _ol_Feature_({
geometry: new _ol_geom_Point_([0, 0]),
name: 'Null Island',
population: 4000,
rainfall: 500
});
var iconStyle = new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
var iconStyle = new _ol_style_Style_({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
@@ -29,25 +29,25 @@ var iconStyle = new ol.style.Style({
iconFeature.setStyle(iconStyle);
var vectorSource = new ol.source.Vector({
var vectorSource = new _ol_source_Vector_({
features: [iconFeature]
});
var vectorLayer = new ol.layer.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: vectorSource
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.TileJSON({
var rasterLayer = new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
crossOrigin: ''
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [rasterLayer, vectorLayer],
target: document.getElementById('map'),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 3
})
@@ -55,7 +55,7 @@ var map = new ol.Map({
var element = document.getElementById('popup');
var popup = new ol.Overlay({
var popup = new _ol_Overlay_({
element: element,
positioning: 'bottom-center',
stopEvent: false,

View File

@@ -1,18 +1,18 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.format.IGC');
goog.require('ol.geom.LineString');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_format_IGC_ from '../src/ol/format/IGC.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var colors = {
@@ -28,8 +28,8 @@ var styleFunction = function(feature) {
var color = colors[feature.get('PLT')];
var style = styleCache[color];
if (!style) {
style = new ol.style.Style({
stroke: new ol.style.Stroke({
style = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: color,
width: 3
})
@@ -39,7 +39,7 @@ var styleFunction = function(feature) {
return style;
};
var vectorSource = new ol.source.Vector();
var vectorSource = new _ol_source_Vector_();
var igcUrls = [
'data/igc/Clement-Latour.igc',
@@ -58,7 +58,7 @@ function get(url, callback) {
client.send();
}
var igcFormat = new ol.format.IGC();
var igcFormat = new _ol_format_IGC_();
for (var i = 0; i < igcUrls.length; ++i) {
get(igcUrls[i], function(data) {
var features = igcFormat.readFeatures(data,
@@ -80,30 +80,30 @@ vectorSource.on('addfeature', function(event) {
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM({
new _ol_layer_Tile_({
source: new _ol_source_OSM_({
attributions: [
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
ol.source.OSM.ATTRIBUTION
_ol_source_OSM_.ATTRIBUTION
],
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
})
}),
new ol.layer.Vector({
new _ol_layer_Vector_({
source: vectorSource,
style: styleFunction
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [703365.7089403362, 5714629.865071137],
zoom: 9
})
@@ -123,7 +123,7 @@ var displaySnap = function(coordinate) {
var geometry = closestFeature.getGeometry();
var closestPoint = geometry.getClosestPoint(coordinate);
if (point === null) {
point = new ol.geom.Point(closestPoint);
point = new _ol_geom_Point_(closestPoint);
} else {
point.setCoordinates(closestPoint);
}
@@ -132,7 +132,7 @@ var displaySnap = function(coordinate) {
closestFeature.get('PLT') + ' (' + date.toUTCString() + ')';
var coordinates = [coordinate, [closestPoint[0], closestPoint[1]]];
if (line === null) {
line = new ol.geom.LineString(coordinates);
line = new _ol_geom_LineString_(coordinates);
} else {
line.setCoordinates(coordinates);
}
@@ -152,13 +152,13 @@ map.on('click', function(evt) {
displaySnap(evt.coordinate);
});
var stroke = new ol.style.Stroke({
var stroke = new _ol_style_Stroke_({
color: 'rgba(255,0,0,0.9)',
width: 1
});
var style = new ol.style.Style({
var style = new _ol_style_Style_({
stroke: stroke,
image: new ol.style.Circle({
image: new _ol_style_Circle_({
radius: 5,
fill: null,
stroke: stroke
@@ -175,13 +175,13 @@ map.on('postcompose', function(evt) {
}
});
var featureOverlay = new ol.layer.Vector({
source: new ol.source.Vector(),
var featureOverlay = new _ol_layer_Vector_({
source: new _ol_source_Vector_(),
map: map,
style: new ol.style.Style({
image: new ol.style.Circle({
style: new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 5,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.9)'
})
})
@@ -196,7 +196,7 @@ document.getElementById('time').addEventListener('input', function() {
var coordinate = geometry.getCoordinateAtM(m, true);
var highlight = feature.get('highlight');
if (highlight === undefined) {
highlight = new ol.Feature(new ol.geom.Point(coordinate));
highlight = new _ol_Feature_(new _ol_geom_Point_(coordinate));
feature.set('highlight', highlight);
featureOverlay.getSource().addFeature(highlight);
} else {

View File

@@ -1,20 +1,20 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.BingMaps');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var imagery = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
var imagery = new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({key: key, imagerySet: 'Aerial'})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [imagery],
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([-120, 50]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([-120, 50]),
zoom: 6
})
});

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.source.ImageWMS');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_source_ImageWMS_ from '../src/ol/source/ImageWMS.js';
/**
@@ -77,7 +77,7 @@ Progress.prototype.hide = function() {
var progress = new Progress(document.getElementById('progress'));
var source = new ol.source.ImageWMS({
var source = new _ol_source_ImageWMS_({
url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'topp:states'},
serverType: 'geoserver'
@@ -94,13 +94,13 @@ source.on('imageloaderror', function() {
progress.addLoaded();
});
var map = new ol.Map({
var map = new _ol_Map_({
logo: false,
layers: [
new ol.layer.Image({source: source})
new _ol_layer_Image_({source: source})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-10997148, 4569099],
zoom: 4
})

View File

@@ -1,32 +1,32 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
goog.require('ol.style.Text');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js';
var style = new ol.style.Style({
fill: new ol.style.Fill({
var style = new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#319FD3',
width: 1
}),
text: new ol.style.Text()
text: new _ol_style_Text_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Vector({
new _ol_layer_Vector_({
renderMode: 'image',
source: new ol.source.Vector({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON()
format: new _ol_format_GeoJSON_()
}),
style: function(feature) {
style.getText().setText(feature.get('name'));
@@ -35,21 +35,21 @@ var map = new ol.Map({
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 1
})
});
var featureOverlay = new ol.layer.Vector({
source: new ol.source.Vector(),
var featureOverlay = new _ol_layer_Vector_({
source: new _ol_source_Vector_(),
map: map,
style: new ol.style.Style({
stroke: new ol.style.Stroke({
style: new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#f00',
width: 1
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.1)'
})
})

View File

@@ -1,20 +1,20 @@
// NOCOMPILE
// this example uses JSTS for which we don't have an externs file.
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var source = new ol.source.Vector();
var source = new _ol_source_Vector_();
fetch('data/geojson/roads-seoul.geojson').then(function(response) {
return response.json();
}).then(function(json) {
var format = new ol.format.GeoJSON();
var format = new _ol_format_GeoJSON_();
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
var parser = new jsts.io.OL3Parser();
@@ -33,19 +33,19 @@ fetch('data/geojson/roads-seoul.geojson').then(function(response) {
source.addFeatures(features);
});
var vectorLayer = new ol.layer.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: source
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.OSM()
var rasterLayer = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [rasterLayer, vectorLayer],
target: document.getElementById('map'),
view: new ol.View({
center: ol.proj.fromLonLat([126.979293, 37.528787]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([126.979293, 37.528787]),
zoom: 15
})
});

View File

@@ -1,14 +1,14 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.KML');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var styleCache = {};
@@ -21,13 +21,13 @@ var styleFunction = function(feature) {
var radius = 5 + 20 * (magnitude - 5);
var style = styleCache[radius];
if (!style) {
style = new ol.style.Style({
image: new ol.style.Circle({
style = new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: radius,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255, 153, 0, 0.4)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'rgba(255, 204, 0, 0.2)',
width: 1
})
@@ -38,26 +38,26 @@ var styleFunction = function(feature) {
return style;
};
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({
format: new _ol_format_KML_({
extractStyles: false
})
}),
style: styleFunction
});
var raster = new ol.layer.Tile({
source: new ol.source.Stamen({
var raster = new _ol_layer_Tile_({
source: new _ol_source_Stamen_({
layer: 'toner'
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.KML');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Stamen_ from '../src/ol/source/Stamen.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
/*
@@ -35,36 +35,36 @@ var styleFunction = function(feature) {
delta = 24 - delta;
}
var opacity = 0.75 * (1 - delta / 12);
return new ol.style.Style({
fill: new ol.style.Fill({
return new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: [0xff, 0xff, 0x33, opacity]
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#ffffff'
})
});
};
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/timezones.kml',
format: new ol.format.KML({
format: new _ol_format_KML_({
extractStyles: false
})
}),
style: styleFunction
});
var raster = new ol.layer.Tile({
source: new ol.source.Stamen({
var raster = new _ol_layer_Tile_({
source: new _ol_source_Stamen_({
layer: 'toner'
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,32 +1,32 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.KML');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.BingMaps');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_KML_ from '../src/ol/format/KML.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var projection = ol.proj.get('EPSG:3857');
var projection = _ol_proj_.get('EPSG:3857');
var raster = new ol.layer.Tile({
source: new ol.source.BingMaps({
var raster = new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
imagerySet: 'Aerial',
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
})
});
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/kml/2012-02-10.kml',
format: new ol.format.KML()
format: new _ol_format_KML_()
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: document.getElementById('map'),
view: new ol.View({
view: new _ol_View_({
center: [876970.8463461736, 5859807.853963373],
projection: projection,
zoom: 10

View File

@@ -1,11 +1,11 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.has');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_has_ from '../src/ol/has.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
if (!ol.has.WEBGL) {
if (!_ol_has_.WEBGL) {
var info = document.getElementById('no-webgl');
/**
* display error message
@@ -13,20 +13,20 @@ if (!ol.has.WEBGL) {
info.style.display = '';
} else {
var osm = new ol.layer.Tile({
source: new ol.source.OSM()
var osm = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [osm],
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var osm = new ol.layer.Tile({
source: new ol.source.OSM()
var osm = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [osm],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,11 +1,11 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.TileJSON');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
function transform(extent) {
return ol.proj.transformExtent(extent, 'EPSG:4326', 'EPSG:3857');
return _ol_proj_.transformExtent(extent, 'EPSG:4326', 'EPSG:3857');
}
var extents = {
@@ -15,25 +15,25 @@ var extents = {
Sweden: transform([11.02737, 55.36174, 23.90338, 69.10625])
};
var base = new ol.layer.Tile({
source: new ol.source.TileJSON({
var base = new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-light.json?secure',
crossOrigin: 'anonymous'
})
});
var overlay = new ol.layer.Tile({
var overlay = new _ol_layer_Tile_({
extent: extents.India,
source: new ol.source.TileJSON({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-black.json?secure',
crossOrigin: 'anonymous'
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [base, overlay],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 1
})

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Group');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.TileJSON');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Group_ from '../src/ol/layer/Group.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}), new ol.layer.Group({
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
}), new _ol_layer_Group_({
layers: [
new ol.layer.Tile({
source: new ol.source.TileJSON({
new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure',
crossOrigin: 'anonymous'
})
}),
new ol.layer.Tile({
source: new ol.source.TileJSON({
new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
crossOrigin: 'anonymous'
})
@@ -28,8 +28,8 @@ var map = new ol.Map({
})
],
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([37.40570, 8.81566]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([37.40570, 8.81566]),
zoom: 4
})
});
@@ -49,7 +49,7 @@ function bindInputs(layerid, layer) {
}
map.getLayers().forEach(function(layer, i) {
bindInputs('#layer' + i, layer);
if (layer instanceof ol.layer.Group) {
if (layer instanceof _ol_layer_Group_) {
layer.getLayers().forEach(function(sublayer, j) {
bindInputs('#layer' + i + j, sublayer);
});

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.BingMaps');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var roads = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Road'})
var roads = new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({key: key, imagerySet: 'Road'})
});
var imagery = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
var imagery = new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({key: key, imagerySet: 'Aerial'})
});
var container = document.getElementById('map');
var map = new ol.Map({
var map = new _ol_Map_({
layers: [roads, imagery],
target: container,
view: new ol.View({
center: ol.proj.fromLonLat([-109, 46.5]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([-109, 46.5]),
zoom: 6
})
});

View File

@@ -1,29 +1,29 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var osm = new ol.layer.Tile({
source: new ol.source.OSM()
var osm = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var bing = new ol.layer.Tile({
source: new ol.source.BingMaps({
var bing = new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial'
})
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [osm, bing],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,30 +1,30 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.RegularShape');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Feature_ from '../src/ol/Feature.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var stroke = new ol.style.Stroke({color: 'black', width: 1});
var stroke = new _ol_style_Stroke_({color: 'black', width: 1});
var styles = {
'square': new ol.style.Style({
image: new ol.style.RegularShape({
fill: new ol.style.Fill({color: 'blue'}),
'square': new _ol_style_Style_({
image: new _ol_style_RegularShape_({
fill: new _ol_style_Fill_({color: 'blue'}),
stroke: stroke,
points: 4,
radius: 80,
angle: Math.PI / 4
})
}),
'triangle': new ol.style.Style({
image: new ol.style.RegularShape({
fill: new ol.style.Fill({color: 'red'}),
'triangle': new _ol_style_Style_({
image: new _ol_style_RegularShape_({
fill: new _ol_style_Fill_({color: 'red'}),
stroke: stroke,
points: 3,
radius: 80,
@@ -32,9 +32,9 @@ var styles = {
angle: 0
})
}),
'star': new ol.style.Style({
image: new ol.style.RegularShape({
fill: new ol.style.Fill({color: 'green'}),
'star': new _ol_style_Style_({
image: new _ol_style_RegularShape_({
fill: new _ol_style_Fill_({color: 'green'}),
stroke: stroke,
points: 5,
radius: 80,
@@ -46,14 +46,14 @@ var styles = {
function createLayer(coordinates, style, zIndex) {
var feature = new ol.Feature(new ol.geom.Point(coordinates));
var feature = new _ol_Feature_(new _ol_geom_Point_(coordinates));
feature.setStyle(style);
var source = new ol.source.Vector({
var source = new _ol_source_Vector_({
features: [feature]
});
var vectorLayer = new ol.layer.Vector({
var vectorLayer = new _ol_layer_Vector_({
source: source
});
vectorLayer.setZIndex(zIndex);
@@ -69,10 +69,10 @@ var layers = [];
layers.push(layer1);
layers.push(layer2);
var map = new ol.Map({
var map = new _ol_Map_({
layers: layers,
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 18
})

View File

@@ -1,16 +1,16 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var source = new ol.source.OSM();
var source = new _ol_source_OSM_();
var layer = new ol.layer.Tile();
var layer = new _ol_layer_Tile_();
var map = new ol.Map({
var map = new _ol_Map_({
layers: [layer],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,27 +1,27 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_Point_ from '../src/ol/geom/Point.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var source = new ol.source.Vector();
var source = new _ol_source_Vector_();
var styleFunction = function(feature) {
var geometry = feature.getGeometry();
var styles = [
// linestring
new ol.style.Style({
stroke: new ol.style.Stroke({
new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: '#ffcc33',
width: 2
})
@@ -33,9 +33,9 @@ var styleFunction = function(feature) {
var dy = end[1] - start[1];
var rotation = Math.atan2(dy, dx);
// arrows
styles.push(new ol.style.Style({
geometry: new ol.geom.Point(end),
image: new ol.style.Icon({
styles.push(new _ol_style_Style_({
geometry: new _ol_geom_Point_(end),
image: new _ol_style_Icon_({
src: 'data/arrow.png',
anchor: [0.75, 0.5],
rotateWithView: true,
@@ -46,21 +46,21 @@ var styleFunction = function(feature) {
return styles;
};
var vector = new ol.layer.Vector({
var vector = new _ol_layer_Vector_({
source: source,
style: styleFunction
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-11000000, 4600000],
zoom: 4
})
});
map.addInteraction(new ol.interaction.Draw({
map.addInteraction(new _ol_interaction_Draw_({
source: source,
type: 'LineString'
}));

View File

@@ -1,26 +1,26 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var openCycleMapLayer = new ol.layer.Tile({
source: new ol.source.OSM({
var openCycleMapLayer = new _ol_layer_Tile_({
source: new _ol_source_OSM_({
attributions: [
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
ol.source.OSM.ATTRIBUTION
_ol_source_OSM_.ATTRIBUTION
],
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
})
});
var openSeaMapLayer = new ol.layer.Tile({
source: new ol.source.OSM({
var openSeaMapLayer = new _ol_layer_Tile_({
source: new _ol_source_OSM_({
attributions: [
'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
ol.source.OSM.ATTRIBUTION
_ol_source_OSM_.ATTRIBUTION
],
opaque: false,
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
@@ -28,18 +28,18 @@ var openSeaMapLayer = new ol.layer.Tile({
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
openCycleMapLayer,
openSeaMapLayer
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
maxZoom: 18,
center: [-244780.24508882355, 5986452.183179816],
zoom: 15

View File

@@ -1,22 +1,22 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.BingMaps');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var imagery = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
var imagery = new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({key: key, imagerySet: 'Aerial'})
});
var container = document.getElementById('map');
var map = new ol.Map({
var map = new _ol_Map_({
layers: [imagery],
target: container,
view: new ol.View({
center: ol.proj.fromLonLat([-109, 46.5]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([-109, 46.5]),
zoom: 6
})
});

View File

@@ -1,15 +1,15 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.MVT');
goog.require('ol.layer.VectorTile');
goog.require('ol.proj');
goog.require('ol.source.VectorTile');
goog.require('ol.style.Fill');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
goog.require('ol.style.Text');
goog.require('ol.tilegrid.TileGrid');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_MVT_ from '../src/ol/format/MVT.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js';
import _ol_tilegrid_TileGrid_ from '../src/ol/tilegrid/TileGrid.js';
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
@@ -30,26 +30,26 @@ function tileUrlFunction(tileCoord) {
((tileCoord[1] << tileCoord[0]) + tileCoord[2]) % 4, 1));
}
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
new _ol_layer_VectorTile_({
source: new _ol_source_VectorTile_({
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="https://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>',
format: new ol.format.MVT(),
tileGrid: new ol.tilegrid.TileGrid({
extent: ol.proj.get('EPSG:3857').getExtent(),
format: new _ol_format_MVT_(),
tileGrid: new _ol_tilegrid_TileGrid_({
extent: _ol_proj_.get('EPSG:3857').getExtent(),
resolutions: resolutions,
tileSize: 512
}),
tileUrlFunction: tileUrlFunction
}),
style: createMapboxStreetsV6Style(ol.style.Style, ol.style.Fill, ol.style.Stroke, ol.style.Icon, ol.style.Text)
style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
minZoom: 1,
zoom: 2

View File

@@ -1,34 +1,34 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.MVT');
goog.require('ol.layer.VectorTile');
goog.require('ol.source.VectorTile');
goog.require('ol.style.Fill');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
goog.require('ol.style.Text');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_MVT_ from '../src/ol/format/MVT.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js';
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.VectorTile({
new _ol_layer_VectorTile_({
declutter: true,
source: new ol.source.VectorTile({
source: new _ol_source_VectorTile_({
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="https://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>',
format: new ol.format.MVT(),
format: new _ol_format_MVT_(),
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key
}),
style: createMapboxStreetsV6Style(ol.style.Style, ol.style.Fill, ol.style.Stroke, ol.style.Icon, ol.style.Text)
style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.source.ImageMapGuide');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_source_ImageMapGuide_ from '../src/ol/source/ImageMapGuide.js';
var mdf = 'Library://Public/Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
var agentUrl =
@@ -12,11 +12,11 @@ var bounds = [
-87.595394059497067,
43.823852564430069
];
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Image({
new _ol_layer_Image_({
extent: bounds,
source: new ol.source.ImageMapGuide({
source: new _ol_source_ImageMapGuide_({
projection: 'EPSG:4326',
url: agentUrl,
useOverlay: false,
@@ -32,7 +32,7 @@ var map = new ol.Map({
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-87.7302542509315, 43.744459064634],
projection: 'EPSG:4326',
zoom: 12

View File

@@ -1,40 +1,40 @@
goog.require('ol.Map');
goog.require('ol.Observable');
goog.require('ol.Overlay');
goog.require('ol.Sphere');
goog.require('ol.View');
goog.require('ol.geom.LineString');
goog.require('ol.geom.Polygon');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_Observable_ from '../src/ol/Observable.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_Sphere_ from '../src/ol/Sphere.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_geom_LineString_ from '../src/ol/geom/LineString.js';
import _ol_geom_Polygon_ from '../src/ol/geom/Polygon.js';
import _ol_interaction_Draw_ from '../src/ol/interaction/Draw.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var source = new ol.source.Vector();
var source = new _ol_source_Vector_();
var vector = new ol.layer.Vector({
var vector = new _ol_layer_Vector_({
source: source,
style: new ol.style.Style({
fill: new ol.style.Fill({
style: new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#ffcc33',
width: 2
}),
image: new ol.style.Circle({
image: new _ol_style_Circle_({
radius: 7,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: '#ffcc33'
})
})
@@ -104,9 +104,9 @@ var pointerMoveHandler = function(evt) {
if (sketch) {
var geom = (sketch.getGeometry());
if (geom instanceof ol.geom.Polygon) {
if (geom instanceof _ol_geom_Polygon_) {
helpMsg = continuePolygonMsg;
} else if (geom instanceof ol.geom.LineString) {
} else if (geom instanceof _ol_geom_LineString_) {
helpMsg = continueLineMsg;
}
}
@@ -118,10 +118,10 @@ var pointerMoveHandler = function(evt) {
};
var map = new ol.Map({
var map = new _ol_Map_({
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-11000000, 4600000],
zoom: 15
})
@@ -144,7 +144,7 @@ var draw; // global so we can remove it later
* @return {string} The formatted length.
*/
var formatLength = function(line) {
var length = ol.Sphere.getLength(line);
var length = _ol_Sphere_.getLength(line);
var output;
if (length > 100) {
output = (Math.round(length / 1000 * 100) / 100) +
@@ -163,7 +163,7 @@ var formatLength = function(line) {
* @return {string} Formatted area.
*/
var formatArea = function(polygon) {
var area = ol.Sphere.getArea(polygon);
var area = _ol_Sphere_.getArea(polygon);
var output;
if (area > 10000) {
output = (Math.round(area / 1000000 * 100) / 100) +
@@ -177,24 +177,24 @@ var formatArea = function(polygon) {
function addInteraction() {
var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString');
draw = new ol.interaction.Draw({
draw = new _ol_interaction_Draw_({
source: source,
type: type,
style: new ol.style.Style({
fill: new ol.style.Fill({
style: new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)'
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'rgba(0, 0, 0, 0.5)',
lineDash: [10, 10],
width: 2
}),
image: new ol.style.Circle({
image: new _ol_style_Circle_({
radius: 5,
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: 'rgba(0, 0, 0, 0.7)'
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)'
})
})
@@ -217,10 +217,10 @@ function addInteraction() {
listener = sketch.getGeometry().on('change', function(evt) {
var geom = evt.target;
var output;
if (geom instanceof ol.geom.Polygon) {
if (geom instanceof _ol_geom_Polygon_) {
output = formatArea(geom);
tooltipCoord = geom.getInteriorPoint().getCoordinates();
} else if (geom instanceof ol.geom.LineString) {
} else if (geom instanceof _ol_geom_LineString_) {
output = formatLength(geom);
tooltipCoord = geom.getLastCoordinate();
}
@@ -238,7 +238,7 @@ function addInteraction() {
// unset tooltip so that a new one can be created
measureTooltipElement = null;
createMeasureTooltip();
ol.Observable.unByKey(listener);
_ol_Observable_.unByKey(listener);
}, this);
}
@@ -252,7 +252,7 @@ function createHelpTooltip() {
}
helpTooltipElement = document.createElement('div');
helpTooltipElement.className = 'tooltip hidden';
helpTooltip = new ol.Overlay({
helpTooltip = new _ol_Overlay_({
element: helpTooltipElement,
offset: [15, 0],
positioning: 'center-left'
@@ -270,7 +270,7 @@ function createMeasureTooltip() {
}
measureTooltipElement = document.createElement('div');
measureTooltipElement.className = 'tooltip tooltip-measure';
measureTooltip = new ol.Overlay({
measureTooltip = new _ol_Overlay_({
element: measureTooltipElement,
offset: [0, -15],
positioning: 'bottom-center'

View File

@@ -1,23 +1,23 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.TileJSON');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
/**
* Create the map.
*/
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM(),
new _ol_layer_Tile_({
source: new _ol_source_OSM_(),
minResolution: 200,
maxResolution: 2000
}),
new ol.layer.Tile({
source: new ol.source.TileJSON({
new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
crossOrigin: 'anonymous'
}),
@@ -26,12 +26,12 @@ var map = new ol.Map({
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [653600, 5723680],
zoom: 5
})

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var viewport = document.getElementById('map');
@@ -12,16 +12,16 @@ function getMinZoom() {
var initialZoom = getMinZoom();
var view = new ol.View({
var view = new _ol_View_({
center: [0, 0],
minZoom: initialZoom,
zoom: initialZoom
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',

View File

@@ -1,19 +1,19 @@
goog.require('ol.Geolocation');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
import _ol_Geolocation_ from '../src/ol/Geolocation.js';
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var view = new ol.View({
var view = new _ol_View_({
center: [0, 0],
zoom: 2
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
new _ol_layer_Tile_({
source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Road'
})
@@ -23,7 +23,7 @@ var map = new ol.Map({
view: view
});
var geolocation = new ol.Geolocation({
var geolocation = new _ol_Geolocation_({
projection: view.getProjection(),
tracking: true
});

View File

@@ -1,40 +1,40 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.interaction');
goog.require('ol.interaction.Modify');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
var raster = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
var vector = new _ol_layer_Vector_({
source: new _ol_source_Vector_({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON(),
format: new _ol_format_GeoJSON_(),
wrapX: false
})
});
var select = new ol.interaction.Select({
var select = new _ol_interaction_Select_({
wrapX: false
});
var modify = new ol.interaction.Modify({
var modify = new _ol_interaction_Modify_({
features: select.getFeatures()
});
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([select, modify]),
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults().extend([select, modify]),
layers: [raster, vector],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,55 +1,55 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.interaction');
goog.require('ol.interaction.Modify');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_Modify_ from '../src/ol/interaction/Modify.js';
import _ol_interaction_Select_ from '../src/ol/interaction/Select.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var styleFunction = (function() {
var styles = {};
var image = new ol.style.Circle({
var image = new _ol_style_Circle_({
radius: 5,
fill: null,
stroke: new ol.style.Stroke({color: 'orange', width: 2})
stroke: new _ol_style_Stroke_({color: 'orange', width: 2})
});
styles['Point'] = new ol.style.Style({image: image});
styles['Polygon'] = new ol.style.Style({
stroke: new ol.style.Stroke({
styles['Point'] = new _ol_style_Style_({image: image});
styles['Polygon'] = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'blue',
width: 3
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(0, 0, 255, 0.1)'
})
});
styles['MultiLineString'] = new ol.style.Style({
stroke: new ol.style.Stroke({
styles['MultiLineString'] = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'green',
width: 3
})
});
styles['MultiPolygon'] = new ol.style.Style({
stroke: new ol.style.Stroke({
styles['MultiPolygon'] = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'yellow',
width: 1
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 0, 0.1)'
})
});
styles['default'] = new ol.style.Style({
stroke: new ol.style.Stroke({
styles['default'] = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'red',
width: 3
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(255, 0, 0, 0.1)'
}),
image: image
@@ -144,11 +144,11 @@ var geojsonObject = {
}]
};
var source = new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures(geojsonObject)
var source = new _ol_source_Vector_({
features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
});
var layer = new ol.layer.Vector({
var layer = new _ol_layer_Vector_({
source: source,
style: styleFunction
});
@@ -156,19 +156,19 @@ var layer = new ol.layer.Vector({
var overlayStyle = (function() {
var styles = {};
styles['Polygon'] = [
new ol.style.Style({
fill: new ol.style.Fill({
new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: [255, 255, 255, 0.5]
})
}),
new ol.style.Style({
stroke: new ol.style.Stroke({
new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 1],
width: 5
})
}),
new ol.style.Style({
stroke: new ol.style.Stroke({
new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: [0, 153, 255, 1],
width: 3
})
@@ -177,14 +177,14 @@ var overlayStyle = (function() {
styles['MultiPolygon'] = styles['Polygon'];
styles['LineString'] = [
new ol.style.Style({
stroke: new ol.style.Stroke({
new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 1],
width: 5
})
}),
new ol.style.Style({
stroke: new ol.style.Stroke({
new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: [0, 153, 255, 1],
width: 3
})
@@ -193,13 +193,13 @@ var overlayStyle = (function() {
styles['MultiLineString'] = styles['LineString'];
styles['Point'] = [
new ol.style.Style({
image: new ol.style.Circle({
new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 7,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: [0, 153, 255, 1]
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 0.75],
width: 1.5
})
@@ -216,11 +216,11 @@ var overlayStyle = (function() {
};
})();
var select = new ol.interaction.Select({
var select = new _ol_interaction_Select_({
style: overlayStyle
});
var modify = new ol.interaction.Modify({
var modify = new _ol_interaction_Modify_({
features: select.getFeatures(),
style: overlayStyle,
insertVertexCondition: function() {
@@ -231,11 +231,11 @@ var modify = new ol.interaction.Modify({
}
});
var map = new ol.Map({
interactions: ol.interaction.defaults().extend([select, modify]),
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults().extend([select, modify]),
layers: [layer],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 1000000],
zoom: 2
})

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.MousePosition');
goog.require('ol.coordinate');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_MousePosition_ from '../src/ol/control/MousePosition.js';
import _ol_coordinate_ from '../src/ol/coordinate.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var mousePositionControl = new ol.control.MousePosition({
coordinateFormat: ol.coordinate.createStringXY(4),
var mousePositionControl = new _ol_control_MousePosition_({
coordinateFormat: _ol_coordinate_.createStringXY(4),
projection: 'EPSG:4326',
// comment the following two lines to have the mouse position
// be placed within the map.
@@ -16,19 +16,19 @@ var mousePositionControl = new ol.control.MousePosition({
undefinedHTML: '&nbsp;'
});
var map = new ol.Map({
controls: ol.control.defaults({
var map = new _ol_Map_({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}).extend([mousePositionControl]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
@@ -41,6 +41,6 @@ projectionSelect.addEventListener('change', function(event) {
var precisionInput = document.getElementById('precision');
precisionInput.addEventListener('change', function(event) {
var format = ol.coordinate.createStringXY(event.target.valueAsNumber);
var format = _ol_coordinate_.createStringXY(event.target.valueAsNumber);
mousePositionControl.setCoordinateFormat(format);
});

View File

@@ -1,24 +1,24 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.MouseWheelZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_MouseWheelZoom_ from '../src/ol/interaction/MouseWheelZoom.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
interactions: ol.interaction.defaults({mouseWheelZoom: false}).extend([
new ol.interaction.MouseWheelZoom({
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults({mouseWheelZoom: false}).extend([
new _ol_interaction_MouseWheelZoom_({
constrainResolution: true // force zooming to a integer zoom
})
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,25 +1,25 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.extent');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_extent_ from '../src/ol/extent.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
@@ -37,9 +37,9 @@ function wrapLon(value) {
function onMoveEnd(evt) {
var map = evt.map;
var extent = map.getView().calculateExtent(map.getSize());
var bottomLeft = ol.proj.transform(ol.extent.getBottomLeft(extent),
var bottomLeft = _ol_proj_.transform(_ol_extent_.getBottomLeft(extent),
'EPSG:3857', 'EPSG:4326');
var topRight = ol.proj.transform(ol.extent.getTopRight(extent),
var topRight = _ol_proj_.transform(_ol_extent_.getTopRight(extent),
'EPSG:3857', 'EPSG:4326');
display('left', wrapLon(bottomLeft[0]));
display('bottom', bottomLeft[1]);

View File

@@ -1,18 +1,18 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.ZoomToExtent');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_ZoomToExtent_ from '../src/ol/control/ZoomToExtent.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
controls: ol.control.defaults({
var map = new _ol_Map_({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}).extend([
new ol.control.ZoomToExtent({
new _ol_control_ZoomToExtent_({
extent: [
813079.7791264898, 5929220.284081122,
848966.9639063801, 5936863.986909639
@@ -20,12 +20,12 @@ var map = new ol.Map({
})
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,12 +1,12 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.TopoJSON');
goog.require('ol.layer.VectorTile');
goog.require('ol.proj');
goog.require('ol.source.VectorTile');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var key = 'vector-tiles-5eJz6JX';
@@ -16,18 +16,18 @@ var roadColor = {
'minor_road': '#ccb',
'highway': '#f39'
};
var buildingStyle = new ol.style.Style({
fill: new ol.style.Fill({
var buildingStyle = new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: '#666',
opacity: 0.4
}),
stroke: new ol.style.Stroke({
stroke: new _ol_style_Stroke_({
color: '#444',
width: 1
})
});
var waterStyle = new ol.style.Style({
fill: new ol.style.Fill({
var waterStyle = new _ol_style_Style_({
fill: new _ol_style_Fill_({
color: '#9db9e8'
})
});
@@ -46,8 +46,8 @@ var roadStyle = function(feature) {
color = roadColor[kind];
width = kind == 'highway' ? 1.5 : 1;
}
style = new ol.style.Style({
stroke: new ol.style.Stroke({
style = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: color,
width: width
}),
@@ -58,13 +58,13 @@ var roadStyle = function(feature) {
return style;
};
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
new _ol_layer_VectorTile_({
source: new _ol_source_VectorTile_({
attributions: '&copy; OpenStreetMap contributors, Whos On First, ' +
'Natural Earth, and openstreetmapdata.com',
format: new ol.format.TopoJSON({
format: new _ol_format_TopoJSON_({
layerName: 'layer',
layers: ['water', 'roads', 'buildings']
}),
@@ -82,8 +82,8 @@ var map = new ol.Map({
})
],
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([-74.0064, 40.7142]),
view: new _ol_View_({
center: _ol_proj_.fromLonLat([-74.0064, 40.7142]),
maxZoom: 19,
zoom: 15
})

View File

@@ -1,29 +1,29 @@
goog.require('ol.Map');
goog.require('ol.Overlay');
goog.require('ol.View');
goog.require('ol.coordinate');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_coordinate_ from '../src/ol/coordinate.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var layer = new ol.layer.Tile({
source: new ol.source.OSM()
var layer = new _ol_layer_Tile_({
source: new _ol_source_OSM_()
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [layer],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
});
var pos = ol.proj.fromLonLat([16.3725, 48.208889]);
var pos = _ol_proj_.fromLonLat([16.3725, 48.208889]);
// Vienna marker
var marker = new ol.Overlay({
var marker = new _ol_Overlay_({
position: pos,
positioning: 'center-center',
element: document.getElementById('marker'),
@@ -32,14 +32,14 @@ var marker = new ol.Overlay({
map.addOverlay(marker);
// Vienna label
var vienna = new ol.Overlay({
var vienna = new _ol_Overlay_({
position: pos,
element: document.getElementById('vienna')
});
map.addOverlay(vienna);
// Popup showing the position the user clicked
var popup = new ol.Overlay({
var popup = new _ol_Overlay_({
element: document.getElementById('popup')
});
map.addOverlay(popup);
@@ -47,7 +47,7 @@ map.addOverlay(popup);
map.on('click', function(evt) {
var element = popup.getElement();
var coordinate = evt.coordinate;
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
var hdms = _ol_coordinate_.toStringHDMS(_ol_proj_.transform(
coordinate, 'EPSG:3857', 'EPSG:4326'));
$(element).popover('destroy');

View File

@@ -1,19 +1,19 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.OverviewMap');
goog.require('ol.interaction');
goog.require('ol.interaction.DragRotateAndZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_OverviewMap_ from '../src/ol/control/OverviewMap.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_DragRotateAndZoom_ from '../src/ol/interaction/DragRotateAndZoom.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var overviewMapControl = new ol.control.OverviewMap({
var overviewMapControl = new _ol_control_OverviewMap_({
// see in overviewmap-custom.html to see the custom CSS used
className: 'ol-overviewmap ol-custom-overviewmap',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM({
new _ol_layer_Tile_({
source: new _ol_source_OSM_({
'url': 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' +
'?apikey=0e6fc415256d4fbb9b5166a718591d71'
})
@@ -24,20 +24,20 @@ var overviewMapControl = new ol.control.OverviewMap({
collapsed: false
});
var map = new ol.Map({
controls: ol.control.defaults().extend([
var map = new _ol_Map_({
controls: _ol_control_.defaults().extend([
overviewMapControl
]),
interactions: ol.interaction.defaults().extend([
new ol.interaction.DragRotateAndZoom()
interactions: _ol_interaction_.defaults().extend([
new _ol_interaction_DragRotateAndZoom_()
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [500000, 6000000],
zoom: 7
})

View File

@@ -1,21 +1,21 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.OverviewMap');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_OverviewMap_ from '../src/ol/control/OverviewMap.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.OverviewMap()
var map = new _ol_Map_({
controls: _ol_control_.defaults().extend([
new _ol_control_OverviewMap_()
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [500000, 6000000],
zoom: 7
})

View File

@@ -1,8 +1,8 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
// default zoom, center and rotation
var zoom = 2;
@@ -23,19 +23,19 @@ if (window.location.hash !== '') {
}
}
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
controls: ol.control.defaults({
controls: _ol_control_.defaults({
attributionOptions: {
collapsible: false
}
}),
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: center,
zoom: zoom,
rotation: rotation

View File

@@ -1,24 +1,24 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.PinchZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_interaction_ from '../src/ol/interaction.js';
import _ol_interaction_PinchZoom_ from '../src/ol/interaction/PinchZoom.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var map = new ol.Map({
interactions: ol.interaction.defaults({pinchZoom: false}).extend([
new ol.interaction.PinchZoom({
var map = new _ol_Map_({
interactions: _ol_interaction_.defaults({pinchZoom: false}).extend([
new _ol_interaction_PinchZoom_({
constrainResolution: true // force zooming to a integer zoom
})
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new _ol_layer_Tile_({
source: new _ol_source_OSM_()
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.geom.MultiPoint');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_format_GeoJSON_ from '../src/ol/format/GeoJSON.js';
import _ol_geom_MultiPoint_ from '../src/ol/geom/MultiPoint.js';
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
var styles = [
/* We are using two different styles for the polygons:
@@ -17,26 +17,26 @@ var styles = [
* returned as `MultiPoint` geometry, which will be used to render
* the style.
*/
new ol.style.Style({
stroke: new ol.style.Stroke({
new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
color: 'blue',
width: 3
}),
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'rgba(0, 0, 255, 0.1)'
})
}),
new ol.style.Style({
image: new ol.style.Circle({
new _ol_style_Style_({
image: new _ol_style_Circle_({
radius: 5,
fill: new ol.style.Fill({
fill: new _ol_style_Fill_({
color: 'orange'
})
}),
geometry: function(feature) {
// return the coordinates of the first ring of the polygon
var coordinates = feature.getGeometry().getCoordinates()[0];
return new ol.geom.MultiPoint(coordinates);
return new _ol_geom_MultiPoint_(coordinates);
}
})
];
@@ -80,19 +80,19 @@ var geojsonObject = {
}]
};
var source = new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures(geojsonObject)
var source = new _ol_source_Vector_({
features: (new _ol_format_GeoJSON_()).readFeatures(geojsonObject)
});
var layer = new ol.layer.Vector({
var layer = new _ol_layer_Vector_({
source: source,
style: styles
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [layer],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 3000000],
zoom: 2
})

View File

@@ -1,10 +1,10 @@
goog.require('ol.Map');
goog.require('ol.Overlay');
goog.require('ol.View');
goog.require('ol.coordinate');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.TileJSON');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_coordinate_ from '../src/ol/coordinate.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
/**
@@ -18,7 +18,7 @@ var closer = document.getElementById('popup-closer');
/**
* Create an overlay to anchor the popup to the map.
*/
var overlay = new ol.Overlay({
var overlay = new _ol_Overlay_({
element: container,
autoPan: true,
autoPanAnimation: {
@@ -41,10 +41,10 @@ closer.onclick = function() {
/**
* Create the map.
*/
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
source: new ol.source.TileJSON({
new _ol_layer_Tile_({
source: new _ol_source_TileJSON_({
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
crossOrigin: 'anonymous'
})
@@ -52,7 +52,7 @@ var map = new ol.Map({
],
overlays: [overlay],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [0, 0],
zoom: 2
})
@@ -64,7 +64,7 @@ var map = new ol.Map({
*/
map.on('singleclick', function(evt) {
var coordinate = evt.coordinate;
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
var hdms = _ol_coordinate_.toStringHDMS(_ol_proj_.transform(
coordinate, 'EPSG:3857', 'EPSG:4326'));
content.innerHTML = '<p>You clicked here:</p><code>' + hdms +

View File

@@ -1,19 +1,19 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
var view = new ol.View({
var view = new _ol_View_({
center: [-4808600, -2620936],
zoom: 8
});
var map1 = new ol.Map({
var map1 = new _ol_Map_({
layers: [
new ol.layer.Tile({
new _ol_layer_Tile_({
preload: Infinity,
source: new ol.source.BingMaps({
source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial'
})
@@ -23,11 +23,11 @@ var map1 = new ol.Map({
view: view
});
var map2 = new ol.Map({
var map2 = new _ol_Map_({
layers: [
new ol.layer.Tile({
new _ol_layer_Tile_({
preload: 0, // default value
source: new ol.source.BingMaps({
source: new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'AerialWithLabels'
})

View File

@@ -1,11 +1,11 @@
// NOCOMPILE
// this example uses d3 for which we don't have an externs file.
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.source.BingMaps');
goog.require('ol.source.Raster');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_layer_Image_ from '../src/ol/layer/Image.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_BingMaps_ from '../src/ol/source/BingMaps.js';
import _ol_source_Raster_ from '../src/ol/source/Raster.js';
var minVgi = 0;
var maxVgi = 0.25;
@@ -49,7 +49,7 @@ function summarize(value, counts) {
/**
* Use aerial imagery as the input data for the raster source.
*/
var bing = new ol.source.BingMaps({
var bing = new _ol_source_BingMaps_({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial'
});
@@ -59,7 +59,7 @@ var bing = new ol.source.BingMaps({
* Create a raster source where pixels with VGI values above a threshold will
* be colored green.
*/
var raster = new ol.source.Raster({
var raster = new _ol_source_Raster_({
sources: [bing],
/**
* Run calculations on pixel data.
@@ -110,17 +110,17 @@ raster.on('afteroperations', function(event) {
schedulePlot(event.resolution, event.data.counts, event.data.threshold);
});
var map = new ol.Map({
var map = new _ol_Map_({
layers: [
new ol.layer.Tile({
new _ol_layer_Tile_({
source: bing
}),
new ol.layer.Image({
new _ol_layer_Image_({
source: raster
})
],
target: 'map',
view: new ol.View({
view: new _ol_View_({
center: [-9651695, 4937351],
zoom: 13,
minZoom: 12,

Some files were not shown because too many files have changed in this diff Show More