Ticket #41 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Implement ScaleStore

Reported by: dwins Assigned to: sbenthall
Priority: major Milestone: 0.5
Component: GeoExt.data Version:
Keywords: Cc:
State: Review

Description

Provide a store implementation that keeps a list of available zoom levels synchronized with a Map instance.

I'm attaching a patch with such a store, which accepts a configuration like {map: someMapInstance} and provides records with 3 fields:

  • level = the zoom level
  • scale = the scale denominator
  • resolution = the map resolution

Attachments

scalestore.patch (4.8 kB) - added by dwins on 04/14/09 23:34:31.
scalestore.2.patch (10.5 kB) - added by dwins on 04/20/09 18:20:37.
scalestore.3.patch (11.0 kB) - added by dwins on 04/24/09 21:43:37.

Change History

04/14/09 23:34:31 changed by dwins

  • attachment scalestore.patch added.

04/16/09 17:18:32 changed by dwins

  • state changed from None to Review.
  • milestone set to 0.1.

04/16/09 22:22:44 changed by tschaub

  • state changed from Review to Needs more work.

Thanks for the patch dwins. A few initial comments:

  • Other stores that read data from OpenLayers objects have bind and unbind methods (see LayerStore and FeatureStore). If the store is constructed with an OL object, the constructor calls bind. This store could follow the same pattern. Alternatively, someone could not have the store bound to a map and could configure it with an array of scales.
  • If the map does not have a base layer, this will not work. In this case, the bind method could register a listener for the "addlayer" event on the map. The listener should unregister itself when called. Unbind would also unregister the listener (in case it had not been called).
  • See the other stores for examples of inline comments. We're sticking with NaturalDocs syntax for now.
  • It would be good to keep adding to our examples by including one with each new class. You can crib from the existing examples.

04/20/09 18:20:37 changed by dwins

  • attachment scalestore.2.patch added.

04/20/09 18:20:56 changed by dwins

  • state changed from Needs more work to Review.

attached patch addressing above concerns.

04/23/09 17:08:40 changed by ahocevar

  • owner set to ahocevar.

04/24/09 18:48:09 changed by sbenthall

  • owner changed from ahocevar to dwinslow.
  • state changed from Review to Needs more work.

Looks great EXCEPT that the second test fails in IE6.

04/24/09 21:43:37 changed by dwins

  • attachment scalestore.3.patch added.

04/24/09 21:44:41 changed by dwins

  • owner changed from dwinslow to sbenthall.
  • state changed from Needs more work to Review.

this last patch fixes the test in IE6.

04/24/09 23:16:09 changed by sbenthall

  • status changed from new to closed.
  • resolution set to fixed.

(In [466]) A ScaleStore, which takes a map and provides records with information about zoom level, scale denominator, and map resolution. Thanks to dwins for the patch! (Closes #41)