Ticket #750 (closed feature: fixed)

Opened 6 years ago

Last modified 6 years ago

getExtent extended function for Layer.Markers

Reported by: openlayers Owned by: euzuro
Priority: minor Milestone: 2.5 Release
Component: Layer.Markers Version: SVN
Keywords: Cc:
State:

Description

This code allows to getExtend over a group of markers.

Attachments

Openlayers.Layer.Markers.geExtent.patch Download (1.4 KB) - added by openlayers 6 years ago.
getMaxMarkersExtent.patch Download (2.4 KB) - added by euzuro 6 years ago.
let's call that function getMaxMarkersExtent(). If someone wants to change that, please suggest alternative. I've rewritten the code to leverage basetypes code and improve readability.
getDataExtent.patch Download (3.0 KB) - added by euzuro 6 years ago.
renamed and added empty stub to Layer.js so others can follow suit

Change History

Changed 6 years ago by openlayers

Changed 6 years ago by openlayers

  • type changed from bug to feature

Changed 6 years ago by euzuro

seems to me like this line

 if ((this.markers != null) || (this.markers.length > 0)) {

is going to fail if this.markers *is* null

Changed 6 years ago by euzuro

On further review, this seems like it *might* be a useful patch, but that it overrides 'getExtent' is incorrect. It should be a separate function, something more like 'getMarkersExtent' or something of that nature. 'getExtent' gives you the extent of the current viewport for that layer, this is giving the extent of all the markers in the layer, whether they are visible or not.

We've not seen any action on this ticket in three weeks. If anyone is interested in this, please speak up. If it sits for another few weeks, I'll just mark it as won't fix. No use adding code to the trunk that nobody wants.

Changed 6 years ago by openlayers

The idea is to get the max extend of the marker layer so you can zoom to it: map.zoomToExtent(markers.getExtent());

Is it the right use of getExtend, is there another function to do it?

Changed 6 years ago by euzuro

let's call that function getMaxMarkersExtent(). If someone wants to change that, please suggest alternative. I've rewritten the code to leverage basetypes code and improve readability.

Changed 6 years ago by euzuro

  • keywords review added; getextent functions markers removed
  • version set to SVN
  • milestone set to 2.5 Release

new patch all ff and ie6 tests pass. dependent on the reworking of the bounds ticket #929 please review

Changed 6 years ago by crschmidt

THe patch is fine, I'd like to generalize the name so that it can apply to other layer types in the future: getMaxDataExtent() possibly? This would work for both vector and image layers in the case we implement something like that, and we could actually move it up a level to the Layer class if we decide we want something like that in the future.

Erik, thoughts?

Changed 6 years ago by crschmidt

Further thinking:

getMaxDataExtent -> getDataExtent

In the future, we might think of making getDataExtent a wrapper around getTilesBounds(), leading towards a uniform interface for accessing this property on all layers.

For this release, I'd like to not go with that yet, instead sticking to the getDataExtent only on the markers layer while we think if we like the name or not.

Changed 6 years ago by crschmidt

Er, note that the comment on getTilesBounds was about grid subclasses. just random thinking.

Changed 6 years ago by euzuro

renamed and added empty stub to Layer.js so others can follow suit

Changed 6 years ago by crschmidt

  • keywords commit added; review removed

Per discussion with Erik, I'd like to see the Markers.js become an APIMethod -- we are providing it for fully supported application level usage -- and keep the Layers.js as 'unstable'/private for now while we play with this for the next release.

With that change, go ahead to commit.

Changed 6 years ago by euzuro

  • keywords commit removed
  • status changed from new to closed
  • resolution set to fixed

(In [4051]) add getDataExtent() method to layer (experimental) and to markers layer (api supported). thanks for the feature request and original patch, anonymous ol-er :-) (Closes #750)

Note: See TracTickets for help on using tickets.