Ticket #903 (closed feature: wontfix)

Opened 6 years ago

Last modified 6 years ago

would like support for 'Circle' as a geometry type

Reported by: ekoontz Owned by: ekoontz
Priority: minor Milestone:
Component: Geometry.Polygon Version: SVN
Keywords: Cc:
State:

Description

This would be similar to the existing 'Point' type, but it would have a radius. Then one can use it as follows :

var style_planning_notification_circle = {

strokeColor: "grey", fillColor: "green", fillOpacity: 0.5, strokeOpacity: 0.5, strokeWidth: 3, pointerEvents: "visiblePainted"

}; var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry");

// create a circle feature var circle = new OpenLayers.Geometry.Circle(174290,923090,55); var circleFeature = new

OpenLayers.Feature.Vector(circle,null,style_planning_notification_circle);

Attachments

mycirclepatch.diff Download (11.6 KB) - added by ekoontz 6 years ago.
mycirclepatch.2.diff Download (11.6 KB) - added by ekoontz 6 years ago.
mycirclepatch.txt Download (11.6 KB) - added by ekoontz 6 years ago.

Change History

  Changed 6 years ago by ekoontz

  • owner set to ekoontz
  • status changed from new to assigned

Changed 6 years ago by ekoontz

Changed 6 years ago by ekoontz

Changed 6 years ago by ekoontz

follow-up: ↓ 3   Changed 6 years ago by tschaub

For the most part, geometries in OpenLayers correspond to those described by the GML Simple Features Profile ( http://www.ogcnetwork.net/gml-sf). In particular, they are "points, lines, polygons (and collections of these)."

In order to fit in with the other geometry classes, it is important that geometry.calculateBounds sets geometry.bounds as the the envelope of the geometry.

In addition, the geometry.toString method returns Well-Known Text for all geometries. Geometries cannot only be serialized into WKT, but also GML, KML, GeoRSS, and GeoJSON. This is accomplished with the Format classes.

This last bit allows all geometries to be serialized and sent to some persistance layer.

All these things (in my mind) are important (and defining) characteristics of the geometry classes.

Instead of adding additional classes, it is possible to draw various regular (or non-regular) polygons with handlers alone. See  http://dev.openlayers.org/sandbox/tschaub/feature/examples/regular-polygons.html

If this example of circle drawing looks like it would meet your needs, I think this is preferable to having a specific circle class. If you'd like to see the RegularPolygon handler in the trunk - please help write tests for it if you are able.

in reply to: ↑ 2   Changed 6 years ago by ekoontz

  • component changed from Geometry to Tile

thanks for your informative reply; it looks like RegularPolygon as shown in the demo in the sandbox link you provided would satisfy my needs. I will look at how to create tests for the RegularPolygon proposal.

  Changed 6 years ago by ekoontz

  • component changed from Tile to Geometry.Polygon

  Changed 6 years ago by ekoontz

  • priority changed from major to minor

  Changed 6 years ago by tschaub

  • status changed from assigned to closed
  • resolution set to wontfix

I'm closing this - assuming that a many sided polygon will satisfy any circle needs. Please re-open if not.

Note: See TracTickets for help on using tickets.