Fix dynamic-data example migrating map postcompose event
This commit is contained in:
committed by
Tim Schaub
parent
91bd144f0e
commit
3bf9a54ed5
@@ -4,14 +4,14 @@ import {MultiPoint, Point} from '../src/ol/geom.js';
|
|||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import OSM from '../src/ol/source/OSM.js';
|
import OSM from '../src/ol/source/OSM.js';
|
||||||
import {Circle as CircleStyle, Fill, Stroke, Style} from '../src/ol/style.js';
|
import {Circle as CircleStyle, Fill, Stroke, Style} from '../src/ol/style.js';
|
||||||
|
import {getVectorContext} from '../src/ol/render';
|
||||||
|
|
||||||
|
const tileLayer = new TileLayer({
|
||||||
|
source: new OSM()
|
||||||
|
});
|
||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
layers: [
|
layers: [tileLayer],
|
||||||
new TileLayer({
|
|
||||||
source: new OSM()
|
|
||||||
})
|
|
||||||
],
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new View({
|
view: new View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
@@ -46,8 +46,8 @@ const omegaTheta = 30000; // Rotation period in ms
|
|||||||
const R = 7e6;
|
const R = 7e6;
|
||||||
const r = 2e6;
|
const r = 2e6;
|
||||||
const p = 2e6;
|
const p = 2e6;
|
||||||
map.on('postcompose', function(event) {
|
tileLayer.on('postrender', function(event) {
|
||||||
const vectorContext = event.vectorContext;
|
const vectorContext = getVectorContext(event);
|
||||||
const frameState = event.frameState;
|
const frameState = event.frameState;
|
||||||
const theta = 2 * Math.PI * frameState.time / omegaTheta;
|
const theta = 2 * Math.PI * frameState.time / omegaTheta;
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user