ThinkGeo.com    |     Blog    |     Wiki    |     Support

Finding the scale value changes

Dear All,

How to find out, how much scale up or down based on the previous scale value and current scale value.

if scaleup(10) means how much scale increased or scaleDown(10) how much decreased, scale value.

Hi Palani,

I don’t know which version you are using, but for most of our product, the scale will automatic snap to the nearest zoomlevel. For the API scaleup(number) and scaledown(number), it scale a percent like 10% which based it’s original scale value, you can get that in Map.CurrentScale. But if after it scale 10%, it hadn’t reach the next zoomlevel, it will roll back to original value in fact.

For example:
level 1: scale 10000
level 2: scale 1000

level 1 scale 10% to level 2, it’s 9000 now, it hadn’t reach the special value between two levels, so the result should still be scale 10000 but not the 9000.

That means for map render, in most scenario, scaleup(10) is not useful, please call something like scaleup(70), which should looks different on map.

Wish that’s helpful.

Regards,

Don

Dear Don,

ForExample:
My initial MapControl.CurrentScale value = 147647947.

then i am scale down to (10) then i am getting the value of = 132883152.

then i am scale down to (10) then i am getting the value of = 119594837.

Now 2 times i have scale down, then i am setting my slider value to 2.

if suddenly user, using the mouse wheel or Shift left or right mouse drag rectangle. Then how much scale down suppose the value is = 36911986. i have to calculate the scale down to (20) or (40).

Hi Palani,

In your other post I have replied you about how to calculate the slider position.

I think you don’t need to calculate the scale so carefully, because even you are zoom by mouse wheel or Shift left drag rectangle, it will automatic snap to the nearest zoomlevel.

If I misunderstand you please let me know.

Regards,

Don

Dear Don,

A simple statement , if user zoomin or out , how to find out how much scale value increased and decreased.

Suppose: zoomlevel01 = predefined value.
zoomlevel02 = value changed.

how to find out how much scale value will change between two zoomlevel. its fixed value will chage or ?

Hi Palani,

In fact by default the scale value for zoomlevel is a fixed value.

So you can directly get it from a instance of ZoomLevelset.

You can loop all the default 20 levels and read its scale value.

But if you create custom zoomlevelset, the scale value will set by user.

Regards,

Don