-
Notifications
You must be signed in to change notification settings - Fork 59
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
Jump-to-Scale #50
Comments
Before I proceed, there's an extra layer of complexity - though said complexity depends on our desire to be (potentially excessively) precise. GeoMoose 2's function for retrieving the current map scale was dependent on an OpenLayers 2 function, Openlayers 3 doesn't contain either of these functions. OL3 produces a resolution ([projection unit] per pixel), but doesn't provide scale. OL2 relied on a constant, DOTS_PER_INCH, of 72, which would allow conversion of a resolution to a scale: var scale = resolution * OpenLayers.INCHES_PER_UNIT[units] * OpenLayers.DOTS_PER_INCH; We could simply rewrite the function from OL2. However, with more and more mobile devices and high resolution screens, setting an arbitrary DPI of 72 will suit a decreasing number of devices. For example, the DPI of my laptop's screen is 227, and my external monitor is 157. An iPad is listed at 324. Furthermore, automatically detecting a screen's DPI is problematic.
stack overflow #1, #2 , #3 etc... Therefore, before I spend any more time on this - how much, if at all, do we care? |
We care a lot on the PDF outputs.
For the screens, scale seems a bit meaningless especially since the
transition to fake pixels as a kuldge to make hidpi devices work. A lot of
windows machines also don't report dpi correctly (mac has been extremely
good at that in my experience. Display a ruler in preview at 100% and it
matches an actual ruler).
Though isn't there a trick of setting a CSS width to 1in and then reading
it back as px (yep, notices your linked docs)? You could then get the map
width in px and convert that to inches. I suspect the px vs ppx wouldn't
really matter in this case as px as long as things are consistent (units OL
is using to units pulled from CSS).
|
Maybe it is just appropriate to abandon this due to the constraints of device dependence issues. I know we could throw some tricks on this but I'd be a lot happier offering an initial component set that is both accurate and functional. |
My vote would be for make a best effort that scale is meaningful in the interactive map. But make sure the printed scale is correct. (Which is effectively the same strategy as in GM 2.x) |
I don't think we need this component. I'm not a huge fan of forward/up-porting all of the previous components "just because we had them." Particularly those that really have fallen out of favor or need by the general user base. "No one else does this" isn't a true answer but realistically this component is problematic or unneeded:
The mapping at scale problem is a separate problem from this one. Printing is done in a fixed set of units and we have more control over the presentation to make scales more accurate. |
That said: listing a scale on the on-screen interactive map has bugged me and bugs me in other apps when it is clearly wrong (because of bad DPI assumptions). If we can provide an accurate (or usually accurate) on screen scale, I think we should. Reading through the CSS stuff Caitlin posted, I don't see why this is so difficult, except for not wanting to do it. I also don't think we should or shouldn't do anything based on what everyone else is doing. Everyone else is making a world wide slippy map with 3 or 4 layers, limited integration potential, and where it is nearly impossible to make good measurements or see shapes with minimal distortion. We have our own goals. Print to a user specified scale is a must have (with standard presets and the ability for the user to select a non-standard scale.). I am open to it being done differently. So... Given the apparent resistance to implementing this, I suggest looking at it again at a later time (assuming a solution is in place to satisfy printing). |
Your current "pro" list is:
If you look at the links provided by @CaitW then you'd see that, for the most part, they all "agree" that you can't get an accurate DPI on the display. I'm saying we punt on this until someone is really motivated to request it into the future or at least we're willing to invest some better research into integrating scale into the application at large. |
Did you read all of my comments? Summary: We both say punt. |
:) You kept going which made your position unclear. |
For the record some testing: CSS div {width: 1in; border-width: 2px; border-color: black} So yeah, all the cheap c**p lies. It's all over the board. |
I'll leave this here if we ever want to implement it in the future |
Looking through old tickets, I can see this one is basically dead, but wanted to add a comment:
People could use this to navigate multiple levels at a time, but also could get a sense of tile scale if they were familiar enough with the Zoom levels at their latitude. |
You can do this from the dev tools console:
I know this isn't suitable for end users, but I use it to get around when testing. |
- Includes the new jump-to-zoom control - Include docs for above + docs for configuring the scaleline - Adds a new less file for the map. refs: geomoose#50
GeoMoose 2 provided users with a way to jump to a specific scale. It was a small component in the lower right-hand corner of the window. We should make this component available to developers.
The text was updated successfully, but these errors were encountered: