[OpenLayers-Trac] Re: [OpenLayers] #3344: specialized layer for a
grid of points
OpenLayers
trac-20090302 at openlayers.org
Fri Jun 17 14:02:19 EDT 2011
#3344: specialized layer for a grid of points
--------------------------+-------------------------------------------------
Reporter: tschaub | Owner: tschaub
Type: feature | Status: assigned
Priority: minor | Milestone: 2.12 Release
Component: Layer.Vector | Version: 2.10
Keywords: | State: Commit
--------------------------+-------------------------------------------------
Comment(by tschaub):
Replying to [comment:4 bartvde]:
> * why do we add fromBounds if we already have
OpenLayers.Bounds.toGeometry? I personally don't see a need for both.
Can you believe I forgot about Bounds.toGeometry (r5625 was a long time
ago)? Actually, I think toGeometry should be deprecated and fromBounds
should be added, but we don't need the bloat at this point. It makes more
sense that LonLat and Bounds (lower level) don't know about Geometry
(higher level). Whenever we get around to 3.0, this should be reworked.
For now, I'll rework the patch to use toGeometry.
> * why is origin initialized to 0 and not to null? From the docs it's
not entirely clear to me where the origin is located (bottom-left)?
I'll update the initial value to be null. The grid is infinite, so there
is no bottom/left etc. The grid lattice will always be aligned with the
origin. I'll update the docs to clarify this. Let me know if you think
there is a better way to describe it (we could say {{{ (Math.sqrt(Math.pow
(xp-xo, 2) + Math.pow(yp-yo, 2)) * Math.cos(Math.atan2(yp-yo, xp-xo) - r))
% dx === 0}}} and similarly for {{{dy}}} for any point (xp, yp) rotation
(r) and origin (xo, yo)).
> * maxFeatures and setMaxFeatures: is maxFeatures not an {Integer}
always, so why use {Number} in docs?
I go back and forth on this one. There's nothing restricting this value
to an integer, and we only have Number in js anyway.
> * make more explicit in docs that dx and dy are in map units and not in
pixel units?
Good point, will do.
> * in getOrigin shouldn't we protect against getExtent returning null?
Internally, getOrigin is only called on map {{{moveend}}}, so at that
point we should have an extent. If someone calls {{{setSpacing}}} or
other before adding the layer to a map, things will fail. I'll add docs
to clarify this.
> * updateGrid misses docs for force
Added, thanks.
> * make it more explicit in the docs that rotation is negative in the
clockwise direction
Clarified this.
> Other than this it's good to go.
Thanks for the careful review.
--
Ticket URL: <http://trac.openlayers.org/ticket/3344#comment:5>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list