Unified Location Object
Description
The library should provide a single way to represent a point location.
Motivation
Instances of OpenLayers.LonLat and OpenLayers.Geometry.Point provide somewhat redundant functionality. When writing code that deals with vector features, it is a hassle to translate between LonLat and Point. Translating pixel locations into geometry coordinates requires going through a LonLat first. Coordinate transform code also is duplicated for Point and LonLat.
Proposal(s)
- Include Geometry.js and Geometry/Point.js in all builds. Create an alias for the OpenLayers.Geometry.Point constructor. This could be called OpenLayers.Point or something else (OpenLayers.Location). Though something else would probably only increase confusion. This would mean the following would be true (new OpenLayers.Point) instanceof OpenLayers.Geometry.Point. If this strikes people as wrong headed, we could set up the constructor prototypes differently.
- Make a simple OpenLayers.Point constructor (or OpenLayers.Location) and have OpenLayers.Geometry.Point extend OpenLayers.Point objects. This seems weird to me, but someone else might want to justify it.
