Tag Info

Hot answers tagged

2

I think what you're trying to do would use a combo of the Draw tool and the FeatureLayer applyEdits method. This sample kind of gets you started, but the workflow is use Draw tool, on draw-end event, add drawn graphic using applyEdits method of FeatureLayer. I don't have a solid example on hand, but here is a simple-edit-widget and sample code from my book. ...


2

You could run your script, convert the csv and then read the converted data with the OpenLayers.Text-format. But I also think that it's more straightforward to change the way the csv is read if you can't change the csv (on the server side) before you read it with OpenLayers. I just gave it a quick try and it works. I just made a copy of the file "Text.js" ...


1

Why not take a look on the OL.Format.Text code (not a big class) and see if you can extend it to use your own parser? I mean, creating a new OL.Format class that has your own logic on how your data is structured, that is, basically changing some bits on the read method.


1

you can use yourVectorLayer.getSource().getFeaturesAtCoordinate(point). the result is an array, if the its length > 0 then the point in, else not.


1

These kind of operations aren't supported out of the box in ol3. (maybe in the future). But you can use a library like http://turfjs.org , in this case you'll need https://github.com/Turfjs/turf-within or https://github.com/Turfjs/turf-inside You can use ol.format.GeoJSON to convert from a ol3-geometry and geojson for turf and back.


1

The facilities on the map is a featureLayer that comes with graphics that have information you dont need, like the attributes and symbology. You will want to make new graphics based on the graphics in the featureLayer. Replace this line facilities.features = lay.graphics; with this // require the dojo/_base/array module, named arrayUtils here ...



Only top voted, non community-wiki answers of a minimum length are eligible