-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
445c4dd
commit 81d8a58
Showing
12 changed files
with
375 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
|
||
/** | ||
* Run explorer cesium example | ||
* @param id Explorer DOM id | ||
* @param {string} id Explorer DOM id | ||
* @return {Explorer} OpenLayers Explorer instance | ||
*/ | ||
var runExampleCesium = function(id) { | ||
|
||
// ================================================== | ||
// Add explorer | ||
// -------------------------------------------------- | ||
// eslint-disable-next-line no-unused-vars | ||
const runExampleCesium = function(id) { | ||
// ================================================== | ||
// Add explorer | ||
// -------------------------------------------------- | ||
|
||
var explorer = new olexp.Explorer(id); | ||
var layerstm = new ol.layer.Tile({ | ||
source: new ol.source.Stamen({layer: 'watercolor'}) | ||
}); | ||
layerstm.set('name','Stamen'); | ||
explorer.map.addLayer(layerstm); | ||
const explorer = new olexp.Explorer(id); | ||
const layerstm = new ol.layer.Tile({ | ||
source: new ol.source.Stamen({layer: 'watercolor'}), | ||
}); | ||
layerstm.set('name', 'Stamen'); | ||
explorer.map.addLayer(layerstm); | ||
|
||
// ================================================== | ||
// Add cesium | ||
// -------------------------------------------------- | ||
// ================================================== | ||
// Add cesium | ||
// -------------------------------------------------- | ||
|
||
this.ol3d = new olcs.OLCesium({map: explorer.map}); | ||
this.ol3d.setEnabled(true); | ||
explorer.ol3d = new olcs.OLCesium({map: explorer.map}); | ||
explorer.ol3d.setEnabled(true); | ||
|
||
return explorer; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,132 @@ | ||
|
||
/** | ||
* Run explorer layers example | ||
* @param id Explorer DOM id | ||
* @param exmples Examples directory | ||
*/ | ||
var runExampleLayers = function(id, examples) { | ||
|
||
// ================================================== | ||
// Layers Example | ||
// -------------------------------------------------- | ||
|
||
var explorer = new olexp.Explorer(id); | ||
|
||
// ================================================== | ||
// Add OSM map | ||
// -------------------------------------------------- | ||
var layerosm = new ol.layer.Tile({ | ||
source: new ol.source.OSM() | ||
}); | ||
layerosm.set('name','OpenStreetMap'); | ||
|
||
// ================================================== | ||
// Add Stamen map | ||
// -------------------------------------------------- | ||
var layerstm = new ol.layer.Tile({ | ||
source: new ol.source.Stamen({layer: 'watercolor'}) | ||
}); | ||
layerstm.set('name','Stamen'); | ||
|
||
// ================================================== | ||
// Add tiles group | ||
// -------------------------------------------------- | ||
|
||
var tiles = new ol.layer.Group({ | ||
layers: [layerosm, layerstm] | ||
}); | ||
tiles.set('name','Tiles'); | ||
explorer.map.addLayer(tiles); | ||
|
||
// ================================================== | ||
// Add overlay marker and label | ||
// -------------------------------------------------- | ||
var position = ol.proj.transform([-77.016389, 38.904722], | ||
'EPSG:4326', | ||
'EPSG:3857'); | ||
|
||
var marker = new ol.Overlay({ | ||
position: position, | ||
positioning: 'center-center', | ||
element: document.getElementById('marker'), | ||
stopEvent: false | ||
}); | ||
marker.set('name','Washington D.C. Marker'); | ||
explorer.map.addOverlay(marker); | ||
|
||
var label = new ol.Overlay({ | ||
position: position, | ||
element: document.getElementById('label') | ||
}); | ||
label.set('name','Washington D.C. Label'); | ||
explorer.map.addOverlay(label); | ||
|
||
// set center to marker | ||
explorer.map.getView().setCenter(position); | ||
|
||
// ================================================== | ||
// Add image vector | ||
// -------------------------------------------------- | ||
var image = new ol.layer.Image({ | ||
source: new ol.source.ImageVector({ | ||
source: new ol.source.Vector({ | ||
format: new ol.format.GeoJSON(), | ||
url: examples + '/data/geojson/world_cities.json', | ||
}) | ||
}) | ||
}); | ||
image.set('name','World Cities'); | ||
explorer.map.addLayer(image); | ||
|
||
// ================================================== | ||
// Add heatmap | ||
// -------------------------------------------------- | ||
var heatMap = new ol.layer.Heatmap({ | ||
source: new ol.source.Vector({ | ||
url: examples + '/data/kml/2012_Earthquakes_Mag5.kml', | ||
format: new ol.format.KML({extractStyles: false}) | ||
}), | ||
blur: 10, | ||
radius: 10 | ||
}); | ||
heatMap.set('name','Heat Map'); | ||
|
||
// ================================================== | ||
// Add heatmap source | ||
// -------------------------------------------------- | ||
var heatSource = new ol.layer.Vector({ | ||
source: new ol.source.Cluster({ | ||
source: new ol.source.Vector({ | ||
url: examples + '/data/kml/2012_Earthquakes_Mag5.kml', | ||
format: new ol.format.KML() | ||
})}), | ||
style: function(feature, resolution) { | ||
var size = feature.get('features').length; | ||
var style = [new ol.style.Style({ | ||
image: new ol.style.Circle({ | ||
radius: 10, | ||
stroke: new ol.style.Stroke({color: '#ffffff'}), | ||
fill: new ol.style.Fill({color: '#3399CC'}) | ||
}), | ||
text: new ol.style.Text({ | ||
text: size.toString(), | ||
fill: new ol.style.Fill({color: '#ffffff'}) | ||
}) | ||
})]; | ||
return style; | ||
} | ||
}); | ||
heatSource.set('name','Heat Map Source'); | ||
|
||
// ================================================== | ||
// Add heatmap group | ||
// -------------------------------------------------- | ||
|
||
var heatGroup = new ol.layer.Group({ | ||
layers: [heatMap, heatSource] | ||
}); | ||
heatGroup.set('name','Heat Map Group'); | ||
explorer.map.addLayer(heatGroup); | ||
|
||
return explorer; | ||
|
||
}; | ||
/** | ||
* Run explorer layers example | ||
* @param {string} id Explorer DOM id | ||
* @param {string} examples Examples directory | ||
* @return {Explorer} OpenLayer Explorer instance | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
const runExampleLayers = function(id, examples) { | ||
// ================================================== | ||
// Layers Example | ||
// -------------------------------------------------- | ||
|
||
const explorer = new olexp.Explorer(id); | ||
|
||
// ================================================== | ||
// Add OSM map | ||
// -------------------------------------------------- | ||
const layerosm = new ol.layer.Tile({ | ||
source: new ol.source.OSM(), | ||
}); | ||
layerosm.set('name', 'OpenStreetMap'); | ||
|
||
// ================================================== | ||
// Add Stamen map | ||
// -------------------------------------------------- | ||
const layerstm = new ol.layer.Tile({ | ||
source: new ol.source.Stamen({layer: 'watercolor'}), | ||
}); | ||
layerstm.set('name', 'Stamen'); | ||
|
||
// ================================================== | ||
// Add tiles group | ||
// -------------------------------------------------- | ||
|
||
const tiles = new ol.layer.Group({ | ||
layers: [layerosm, layerstm], | ||
}); | ||
tiles.set('name', 'Tiles'); | ||
explorer.map.addLayer(tiles); | ||
|
||
// ================================================== | ||
// Add overlay marker and label | ||
// -------------------------------------------------- | ||
const position = ol.proj.transform([-77.016389, 38.904722], | ||
'EPSG:4326', | ||
'EPSG:3857'); | ||
|
||
const marker = new ol.Overlay({ | ||
position: position, | ||
positioning: 'center-center', | ||
element: document.getElementById('marker'), | ||
stopEvent: false, | ||
}); | ||
marker.set('name', 'Washington D.C. Marker'); | ||
explorer.map.addOverlay(marker); | ||
|
||
const label = new ol.Overlay({ | ||
position: position, | ||
element: document.getElementById('label'), | ||
}); | ||
label.set('name', 'Washington D.C. Label'); | ||
explorer.map.addOverlay(label); | ||
|
||
// set center to marker | ||
explorer.map.getView().setCenter(position); | ||
|
||
// ================================================== | ||
// Add image vector | ||
// -------------------------------------------------- | ||
const image = new ol.layer.Image({ | ||
source: new ol.source.ImageVector({ | ||
source: new ol.source.Vector({ | ||
format: new ol.format.GeoJSON(), | ||
url: examples + '/data/geojson/world_cities.json', | ||
}), | ||
}), | ||
}); | ||
image.set('name', 'World Cities'); | ||
explorer.map.addLayer(image); | ||
|
||
// ================================================== | ||
// Add heatmap | ||
// -------------------------------------------------- | ||
const heatMap = new ol.layer.Heatmap({ | ||
source: new ol.source.Vector({ | ||
url: examples + '/data/kml/2012_Earthquakes_Mag5.kml', | ||
format: new ol.format.KML({extractStyles: false}), | ||
}), | ||
blur: 10, | ||
radius: 10, | ||
}); | ||
heatMap.set('name', 'Heat Map'); | ||
|
||
// ================================================== | ||
// Add heatmap source | ||
// -------------------------------------------------- | ||
const heatSource = new ol.layer.Vector({ | ||
source: new ol.source.Cluster({ | ||
source: new ol.source.Vector({ | ||
url: examples + '/data/kml/2012_Earthquakes_Mag5.kml', | ||
format: new ol.format.KML(), | ||
})}), | ||
style: function(feature, resolution) { | ||
const size = feature.get('features').length; | ||
const style = [new ol.style.Style({ | ||
image: new ol.style.Circle({ | ||
radius: 10, | ||
stroke: new ol.style.Stroke({color: '#ffffff'}), | ||
fill: new ol.style.Fill({color: '#3399CC'}), | ||
}), | ||
text: new ol.style.Text({ | ||
text: size.toString(), | ||
fill: new ol.style.Fill({color: '#ffffff'}), | ||
}), | ||
})]; | ||
return style; | ||
}, | ||
}); | ||
heatSource.set('name', 'Heat Map Source'); | ||
|
||
// ================================================== | ||
// Add heatmap group | ||
// -------------------------------------------------- | ||
|
||
const heatGroup = new ol.layer.Group({ | ||
layers: [heatMap, heatSource], | ||
}); | ||
heatGroup.set('name', 'Heat Map Group'); | ||
explorer.map.addLayer(heatGroup); | ||
|
||
return explorer; | ||
}; |
Oops, something went wrong.