Skip to content
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

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

Open
BP22190 opened this issue May 12, 2023 · 16 comments
Open

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

BP22190 opened this issue May 12, 2023 · 16 comments

Comments

@BP22190
Copy link

BP22190 commented May 12, 2023

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
Copy link
Author

BP22190 commented May 12, 2023

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
Copy link
Owner

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
Copy link
Author

BP22190 commented May 17, 2023

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
Copy link
Author

BP22190 commented May 17, 2023

"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
Copy link
Author

BP22190 commented May 17, 2023

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
Copy link
Owner

> "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
Copy link
Owner

> 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
Copy link
Owner

> 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
Copy link
Author

BP22190 commented May 19, 2023

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
Copy link
Author

BP22190 commented May 20, 2023

About altimetry, send by email...

@activityworkshop
Copy link
Owner

+ " (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
Copy link
Author

BP22190 commented May 31, 2023

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
Copy link
Author

BP22190 commented Jun 2, 2023

how to switch it on and off

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

@activityworkshop
Copy link
Owner

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: #73 (comment)

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
Copy link
Author

BP22190 commented Jun 3, 2023

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 activityworkshop changed the title Max zoom for maps Display of current zoom level, like (z14) Jun 13, 2023
@activityworkshop
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants