Transformed
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
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: 2});
|
||||
var fill = new ol.style.Fill({color: 'red'});
|
||||
var stroke = new _ol_style_Stroke_({color: 'black', width: 2});
|
||||
var fill = new _ol_style_Fill_({color: 'red'});
|
||||
|
||||
var styles = {
|
||||
'square': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
'square': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 4,
|
||||
@@ -23,8 +23,8 @@ var styles = {
|
||||
angle: Math.PI / 4
|
||||
})
|
||||
}),
|
||||
'triangle': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
'triangle': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 3,
|
||||
@@ -33,8 +33,8 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'star': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
'star': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 5,
|
||||
@@ -43,8 +43,8 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'cross': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
'cross': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 4,
|
||||
@@ -53,8 +53,8 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'x': new ol.style.Style({
|
||||
image: new ol.style.RegularShape({
|
||||
'x': new _ol_style_Style_({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
points: 4,
|
||||
@@ -72,24 +72,24 @@ 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));
|
||||
features[i].setStyle(styles[styleKeys[Math.floor(Math.random() * 5)]]);
|
||||
}
|
||||
|
||||
var source = new ol.source.Vector({
|
||||
var source = new _ol_source_Vector_({
|
||||
features: features
|
||||
});
|
||||
|
||||
var vectorLayer = new ol.layer.Vector({
|
||||
var vectorLayer = new _ol_layer_Vector_({
|
||||
source: source
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
var map = new _ol_Map_({
|
||||
layers: [
|
||||
vectorLayer
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
view: new _ol_View_({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user