OpenLayers OpenLayers

Ticket #750 (closed feature: fixed)

Opened 1 year ago

Last modified 1 year ago

getExtent extended function for Layer.Markers

Reported by: openlayers Assigned to: 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 (1.4 kB) - added by openlayers on 06/09/07 10:15:04.
getMaxMarkersExtent.patch (2.4 kB) - added by euzuro on 08/27/07 08:41:13.
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 (3.0 kB) - added by euzuro on 08/27/07 10:28:32.
renamed and added empty stub to Layer.js so others can follow suit

Change History

06/09/07 10:15:04 changed by openlayers

  • attachment Openlayers.Layer.Markers.geExtent.patch added.

06/09/07 10:15:51 changed by openlayers

  • type changed from bug to feature.

06/12/07 15:37:50 changed 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

07/02/07 16:33:43 changed 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.

08/21/07 09:22:08 changed 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?

08/27/07 08:41:13 changed by euzuro

  • attachment getMaxMarkersExtent.patch added.

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.

08/27/07 08:43:13 changed by euzuro

  • keywords changed from getextent functions markers to review.
  • 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

08/27/07 09:00:39 changed 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?

08/27/07 09:07:22 changed 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.

08/27/07 09:08:47 changed by crschmidt

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

08/27/07 10:28:32 changed by euzuro

  • attachment getDataExtent.patch added.

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

08/27/07 10:42:02 changed by crschmidt

  • keywords changed from review to commit.

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.

08/27/07 10:44:46 changed by euzuro

  • keywords deleted.
  • 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)