activityworkshop / GpsPrune

GpsPrune is a map-based application for viewing, editing and converting coordinate data from GPS systems.
GNU General Public License v2.0
67 stars 22 forks source link

Display of current zoom level, like (z14) #73

Open BP22190 opened 1 year ago

BP22190 commented 1 year ago

Hello,

Some maps (for example, Google satellite) are available at a max zoom level more than 20.

So, I suggest increasing the max zoom value in "AddMapSourceDialog.java" in this way (22 in place of 20):

// Max zoom
        c.gridx = 0; c.gridy = 3;
        c.fill = GridBagConstraints.NONE;
        gbPanel.add(new JLabel(I18nManager.getText("dialog.addmapsource.maxzoom")), c);
        _oZoomCombo = new JComboBox<>();
        for (int i=10; i<=22; i++) {
            _oZoomCombo.addItem(i);
        }

Compiled and tested, it works like I want with Google maps.

And a suggestion : possibility to display the active zoom level, near the scale for example.

Best regards

BP22190 commented 1 year ago

And a suggestion : possibility to display the active zoom level, near the scale for example.

I just coded a very simple solution, like that (z value just on the right of the scale):

zzz

Do you want the code (modified ScaleBar.java) ?

activityworkshop commented 1 year ago

About the maximum zoom: sure, why not. The only problem could be that you're taking many many more tile images over the network and (hopefully) saving them in your tile cache, so it will eat more traffic and storage space. But you've deliberately chosen that when you setup the map source so I guess that's ok. I think I'll keep the default mapnik maximum where it is though, even though it could also go higher.

Second suggestion about the z-level: I guess this is just a simple extension of the method "getScaleText", right? Sure, I'll be glad to take the code! My main question isn't how to modify the String though, it's more why you'd want to show the z value. I guess it's because you're doing some work on the maps themselves, right (rather than just using the maps to work on something else). So then the question is how many people actually want to see "(z14)" on their scale bar (if that's the right place to put it) and how many would understand what it even meant?

If some people find it useful and others don't, then we need a way of switching it on and off, so is that switch in the Settings -> Set display options dialog (with a default of off), or does the toggle button at the top of the map change from a two-position toggle (scale bar on / scale bar off) to a three-way switch (scale bar / no scale bar / scale bar + zoom indicator)? What do you think?

BP22190 commented 1 year ago

I will only respond to one topic per post.

"About the maximum zoom..."

I will download more tiles only when the map in question exists at a zoom level of 21 or 22. This will therefore not change the behavior for in particular the preconfigured maps. And anyway, I don't mind because it will be on very small areas.

To work on certain tracks, I need a high level of zoom to be very precise. But if the basemap turns blank, I no longer see where I am. The satellite Google map allows a zoom level 21, even if it is not very precise, and that suits me.

I think that increasing the maximum possible in the dialog box does not change anything for the cards which anyway do not allow a higher level.

BP22190 commented 1 year ago

"Second suggestion about the z-level"

"I guess this is just a simple extension of the method "getScaleText", right?

Yes

"Sure, I'll be glad to take the code!"

how to send it to you? By email ?

"I guess it's because you're doing some work on the maps themselves"

Yes, and the habit because of other software that I use.

"If some people find it useful and others don't... What do you think?"

I think it would be better than what I did very quickly, but it's hard for me to modify this code that I don't know, so I made the easiest for me!

BP22190 commented 1 year ago

PS : I also have a suggestion for you to improve the accuracy of the altimetry (better resolution, 5 meters or less).. I tested a little by modifying the code as I could, it turned out to be effective but not very efficient (too large files to process).

Would you be interested in discussing this? By email ?

Best regards,

activityworkshop commented 1 year ago
> "About the maximum zoom..."

It sounds like you're pretty much just agreeing with what I wrote earlier, so that should be no problem.

activityworkshop commented 1 year ago
> how to send it to you? By email ?

Sure, by email is fine, or just paste it here - I guess it's just a line or two.

> ... but it's hard for me to modify this code that I don't know, so I made the easiest for me!

That's fine, I wasn't asking you to modify the code, I was just asking how you imagine that the control of showing the z-level would ideally work for you. Display settings dialog from the menu or toggle button on the map? Save in settings to remember for next time or not?

Apart from the question whether this should appear next to the scalebar or in the status bar or somewhere else, is it obvious that "z" means zoom level to everybody? What about those working in languages in which the word for zoom doesn't begin with z?

If the "other software that you use" also shows this, then maybe you can tell me which software that is, so I can judge how popular the feature might be? Where else have you seen this, how is it shown, and how do they call it?

activityworkshop commented 1 year ago
> I also have a suggestion for you to improve the accuracy of the altimetry (better resolution, 5 meters or less)..

Yes of course I'm interested, if you have something that's even better than the 1-second SRTM approach. We can discuss here, or you can open a separate issue for it, or we can discuss by email if you prefer.

BP22190 commented 1 year ago

About z-level (surely not the best programming, but it's the first time I'm coding in Java... ;-)

/**
     * Paint method to override display
     * @param inG graphics object
     */
    public void paint(Graphics inG)
    {
        super.paint(inG);
        if (_zoomLevel < 2) {return;}

        final double distScaleFactor = getPixelsPerDist();
        final int scale = getScaleToUse(distScaleFactor);
        if (scale != INVALID_SCALE)
        {
            final int barWidth = getBarWidth(distScaleFactor, scale);
            paintScaleBar(inG, scale, barWidth, _zoomLevel);
        }
    }
/**
     * Draw the components of the scale bar
     * @param inG graphics object
     * @param inScale scale level related to selected units
     * @param inWidth width of scale bar, in pixels
     */
    private void paintScaleBar(Graphics inG, int inScale, int inWidth, int zoomLevel)
    {
...
// text
        final String text = getScaleText(inScale, Config.getUnitSet().getDistanceUnit(), zoomLevel);
        inG.setColor(blankColour);
...
/**
     * Get the scale text for the given scale
     * @param inScale scale number
     * @param inDistUnit distance unit
     * @return scale text as string
     */
    private static String getScaleText(int inScale, Unit inDistUnit, int zoomLevel)
    {
        if (inScale > 0) {
            // Positive scale means km or miles
            return "" + inScale + " " +
                I18nManager.getText(inDistUnit.getShortnameKey()) + " (z" + zoomLevel + ")";
        }
        // negative scale means a fraction
        return "" + (-1.0 / inScale) + " " + I18nManager.getText(inDistUnit.getShortnameKey()) + " (z" + zoomLevel + ")";
        // might be nice to say 100m instead of 0.1km, 275ft instead of 0.2miles, etc - need to be done by Unit itself?
    }
BP22190 commented 1 year ago

About altimetry, send by email...

activityworkshop commented 1 year ago

+ " (z" + zoomLevel + ")"

Absolutely nothing wrong with your java :) The only things missing are as mentioned earlier - how to switch it on and off, and does the z need to change based on the language? If you have examples from other programs that show this, that would be helpful.

BP22190 commented 1 year ago

how to switch it on and off

Don't know... your choice...

does the z need to change based on the language?

I don't think so... "zoom" is about the same in all language no ?

If you have examples from other programs that show this, that would be helpful.

here is from Cartograph Maps for example (in this case, there is the zoom level, but without letter "z") zoomcm3

PS : About altimetry, send by email...

Did you receveid my email ?

BP22190 commented 1 year ago

how to switch it on and off

May be with the scalebar button, with three states : off, scale-bar, scale-bar+ z-level ?

activityworkshop commented 1 year ago

May be with the scalebar button, with three states : off, scale-bar, scale-bar+ z-level ?

yes, that was one of my suggestions in my earlier comment: https://github.com/activityworkshop/GpsPrune/issues/73#issuecomment-1551758645

Your example from Cartograph is interesting, but fairly different from your proposal for GpsPrune. You haven't seen any other software adding something like "(z14)" on the scalebar?

"zoom" is about the same in all language no ?

It begins with a z in a surprisingly high number of languages, but not all.

Did you receveid my email ?

Yes, answered by email. Issue #46 also discusses altitude data.

BP22190 commented 1 year ago

You haven't seen any other software adding something like "(z14)" on the scalebar?

Indicate the zoom level next to the scale bar is just a proposal that seemed the simplest to me. My wish is to have an indication of this zoom level. Here are two other examples, where the zoom level is indicated but elsewhere (RouteConverter and LocusMap). It is obvious that it is up to you to decide where is how it will be best, it is your choice!

RouteConverter : dedicated window zoomrc

LocusMap : status bar, with also percentage of magnification Screenshot_20230603_104544_Locus Map

activityworkshop commented 1 year ago

I renamed the issue, as the original title "Max zoom for maps" has been addressed.