Transformed
This commit is contained in:
@@ -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
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user