0

I recently converted from ESRI products, and I am trying to get a grip on adding a vector layer to OL3 from features returned from the server as WKT.

Here is some example code.

Why I am not seeing a feature in this example?

Note that this pen does work and is very similar: .

  • Are your coordinates correct? Where should they fall according to you? – Devdatta Tengshe Jun 28 '16 at 14:37
  • yes. in that second codepen they fall in alaska. – VBAHole Jun 28 '16 at 14:39
2

Simple typo:

s.addFeatures(f);

Should be

s.addFeatures([f]);

As you only created a single feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.