Geometry.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. define("dojox/geo/openlayers/Geometry", ["dojo/_base/kernel", "dojo/_base/declare"], function(dojo, declare){
  2. return declare("dojox.geo.openlayers.Geometry", null, {
  3. // summary:
  4. // A Geometry handles description of shapes to be rendered in a GfxLayer
  5. // using a GeometryFeature feature.
  6. // A Geometry can be
  7. // - A point geometry of type dojox.geo.openlayers.Point. Coordinates are a an
  8. // Object {x, y}
  9. // - A line string geometry of type dojox.geo.openlayers.LineString. Coordinates are
  10. // an array of {x, y} objects
  11. // - A collection geometry of type dojox.geo.openlayers.Collection. Coordinates are an array of geometries.
  12. // summary:
  13. // The coordinates of the geometry.
  14. // coordinates: {x, y} | Array
  15. coordinates : null,
  16. // summary:
  17. // The associated shape when rendered
  18. // shape : dojox.gfx.Shape
  19. // The shape
  20. // tags:
  21. // internal
  22. shape : null,
  23. constructor : function(coords){
  24. // summary:
  25. // Constructs a new geometry
  26. // coords: {x, y}
  27. // Coordinates of the geometry. {x:<x>, y:<y>} object for a point geometry, array of {x:<x>, y:<y>}
  28. // objects for line string geometry, array of geometries for collection geometry.
  29. this.coordinates = coords;
  30. }
  31. });
  32. });