-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Simplify scaleline calculation #4629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Could you please provide more context @flipper44, i.e. the code or a JSFiddle you used to produce the above image? |
Its hard to show the Ful;l code because it is dynamically built. Everything works up until my first Zoom (scale Bar values are still wrong) because viewState.Resolution is NaN PS this also causes ZoomSlider to crash if I set newProj.units_ = "us-ft"; |
It looks like I will have to manually handle units coming from mapguide for now. The Fix for bad Scale Values: |
You're right @flipper44, the point resolution needs to be multiplied by the meters per unit. I made that change. Now I'll create an example with your WKT def to see if I can reproduce what else is wrong. |
@flipper44 513cf13 fixes your other issue. I also added an example. This is now ready for review. |
projection: 'Indiana-East', | ||
center: ol.proj.fromLonLat([-85.685, 39.891], 'Indiana-East'), | ||
zoom: 7, | ||
minZoom: 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My computer stops working when I get to 5. Might be worth limiting this to 6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also be that enforcing a center constraint with extent
would help.
Re-projection on smaller local coordinate systems does get odd when zOomed way past the local extents. |
Zoom constraint changed, center constraint introduced, degree issue fixed. |
b9d3716
to
192e7bc
Compare
LGTM |
Simplify scaleline calculation
It looks like the scaleline control has some legacy code that is no longer needed now that the projection provides a point resolution in crs units.
Fixes #4572.
Fixes #3444.