Я пытаюсь настроить этот пример:
http://openlayers.org/en/latest/examples/feature-move-animation.html
var strGeoJson = '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":[[25.094146728515625,57.51877294160811],[25.135345458984375,57.55857562213471],[25.11749267578125,57.583614274541404],[25.022735595703125,57.58508660014084],[25.017242431640625,57.633639928856965],[25.11199951171875,57.655688188735766],[25.081787109374996,57.69240553526455],[24.97055053710937,57.68873547372526]]}}]}';
var route = (
new ol.format.Polyline({
factor: 1e6
}).readFeatures(
strGeoJson,
{
dataProjection: 'EPSG:4326',
featureProjection: 'EPSG:3857'
}
)
);
var routeFeature = new ol.Feature({
type: 'route',
geometry: route
});
vectorLayerSource = new ol.source.Vector({
features: [routeFeature]
});
Но все время:
ol.js?20180608153258:47 Uncaught TypeError: a.addEventListener is not a function
at y (ol.js?20180608153258:47)
at Hk.k.Oe (ol.js?20180608153258:302)
at Hk.b (ol.js?20180608153258:46)
at Hk.Sc.b (ol.js?20180608153258:49)
at Yc (ol.js?20180608153258:51)
at Hk.k.set (ol.js?20180608153258:51)
at Hk.k.H (ol.js?20180608153258:52)
at new Hk (ol.js?20180608153258:301)
at HTMLDocument.<anonymous> (history-map:1372)
at i (jquery-2.2.3.min.js:2)
at Object.fireWith [as resolveWith] (jquery-2.2.3.min.js:2)
at Function.ready (jquery-2.2.3.min.js:2)
at HTMLDocument.J (jquery-2.2.3.min.js:2)
Кто-то может сказатьгде проблема?Как нарисовать линию от геойсон.