Add feature manually to a vector layer in ol3

المشرف العام

Administrator
طاقم الإدارة
I'm trying to add a layer manually to a vector layer with javascript. I can't seem to determine why this is failing:

http://jsfiddle.net/Kieveli/f4t6n6v1/4/

I've tried sane coordinates like 16,22, and big ones to match the view's xy values. I get a javascript error from ol3 : TypeError: b.Q is not a function.

Any help is appreciated!

HTML:


Javascript:

var vectorSource = new ol.source.Vector({});var map = new ol.Map({ layers: [ new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'sat'}) }), new ol.layer.Vector({ source: vectorSource }) ], target: 'map', view: new ol.View({ center: [-11000000, 4600000], zoom: 4 })});var thing = new ol.geom.Polygon( [ [16000000,22000000],[44000000,55000000],[88000000,90000000] ] );vectorSource.addFeature( thing );

أكثر...
 
أعلى