How to use the ol-ext/geom/GeomUtils.ol_coordinate_equal function in ol-ext

To help you get started, we’ve selected a few ol-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Viglino / ol-games / graph / Vector.js View on Github external
ol_graph_Vector.prototype.getConnections = function(node, inout, filter) {
  var p = node.getCoordinates ? node.getCoordinates() : node;
  var features = this.edges.getFeaturesInExtent([p[0]-1, p[1]-1, p[0]+1, p[1]+1]);
  var con = inout ? {'in':[],'out':[]} : [];
  // Verify connection
  for (var i=0, c; c=features[i]; i++) if (!filter || filter(c)) {
    if (ol_coordinate_equal(p, c.getGeometry().getFirstCoordinate())) {
      if (inout) con.out.push(c);
      else con.push(c);
    } else if (ol_coordinate_equal(p, c.getGeometry().getLastCoordinate())) {
      if (inout) con.in.push(c);
      else con.push(c);
    }
  }
  return con;
};
github Viglino / ol-games / graph / Vector.js View on Github external
ol_graph_Vector.prototype.getConnections = function(node, inout, filter) {
  var p = node.getCoordinates ? node.getCoordinates() : node;
  var features = this.edges.getFeaturesInExtent([p[0]-1, p[1]-1, p[0]+1, p[1]+1]);
  var con = inout ? {'in':[],'out':[]} : [];
  // Verify connection
  for (var i=0, c; c=features[i]; i++) if (!filter || filter(c)) {
    if (ol_coordinate_equal(p, c.getGeometry().getFirstCoordinate())) {
      if (inout) con.out.push(c);
      else con.push(c);
    } else if (ol_coordinate_equal(p, c.getGeometry().getLastCoordinate())) {
      if (inout) con.in.push(c);
      else con.push(c);
    }
  }
  return con;
};

ol-ext

A set of cool extensions for OpenLayers (ol) in node modules structure

BSD-3-Clause
Latest version published 24 days ago

Package Health Score

83 / 100
Full package analysis