Geometries work very differently in OpenLayers 3. For good reason, because the hierarchical structure of geometry instances to represent a higher level geometry in OpenLayers 2 was quite inefficient.
Why do you want ol.geom.Point instances? I'm sure what you want to do can be handled more efficiently when you work with coordinate arrays. Andreas. On Tue, Jul 19, 2016 at 8:56 PM, João Rodrigues via OL3 Dev <ol3-dev+apn2wqcv7oeyepv6hsk0iibaacfj_vja1kyu4arzmhp3d_bm39ihb...@googlegroups.com> wrote: > Hi Andreas. > > I know what getCoordinates does, but that is not what I want. > > I want method that returns an array of points (array of ol.geom.Point), for > any geometry type. > > Example 1: Point > > var geometry = new ol.geom.Point([-8, 40]); > geometry.getCoordinates(); // Returns [-8, 40] > geometry.getVertices(); // Returns an array with only the point (-8, > 40), as an instance of ol.geom.Point > > > Example 2: LineString > > var geometry = new ol.geom.LineString( [ [-8, 40], [-5, 30], [1, 52] ] ); > geometry.getCoordinates(); // Returns [ [-8, 40], [-5, 30], [1, 52] ] > geometry.getVertices(); // Returns an array with the two end points > (-8, 40) and (1, 52), as a instances of ol.geom.Point > > > Example 3: Polygon > > var geometry = new ol.geom.Polygon( [ [ [-8, 40], [-5, 30], [1, 52], [-8, > 40] ] ] ); > geometry.getCoordinates(); // Returns [ [ [-8, 40], [-5, 30], [1, 52], > [-8, 40] ] ] > geometry.getVertices(); // Returns an array with the three points (not > the closed ring) (-8, 40), (-5, 30) and (1, 52), as a instances of > ol.geom.Point > > Am I right about "getCoordinates"? > > As you can see, I want something different, and you certainly know it > because it was in OpenLayers 2. > > Thanks a lot for your answer. :) > > João Rodrigues > > -- > You received this message because you are subscribed to the Google Groups > "OL3 Dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/ol3-dev. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ol3-dev/57aa5f04-8d14-408c-9dfa-32723d265727%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Andreas Hocevar Geospatial Solutions Engineer | Boundless [email protected] @boundlessgeo -- You received this message because you are subscribed to the Google Groups "OL3 Dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ol3-dev. To view this discussion on the web visit https://groups.google.com/d/msgid/ol3-dev/CAOiJ94hSuZmWmrRafnPbBuW414MMzYfv_sNgTnp%3DKnr3zo%2B_jQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
