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

Mixed up languages on different base map zoom levels #839

Open
realcgslav opened this issue Dec 6, 2023 · 1 comment
Open

Mixed up languages on different base map zoom levels #839

realcgslav opened this issue Dec 6, 2023 · 1 comment
Labels

Comments

@realcgslav
Copy link

Blender and OS versions

Blender 3.6.5, Windows 11

Describe the bug

On different zoom levels I get different languages on a base map. On some levels even several different at once.

How to Reproduce

Add Base Map > Zoom...

1
2

Error message

There is no crash.

@realcgslav
Copy link
Author

I've made little modification to buildURL with Polish (I've wanted it) language - url += "&language=pl":

` def buildUrl(self, laykey, col, row, zoom):
"""
Receive tiles coords in source tile matrix space and build request url
"""
url = self.urlTemplate
lay = self.layers[laykey]
tm = self.srcTms

	if self.service == 'TMS':
		url = url.replace("{LAY}", lay.urlKey)
		if not self.quadTree:
			url = url.replace("{X}", str(col))
			url = url.replace("{Y}", str(row))
			url = url.replace("{Z}", str(zoom))
			**url += "&language=pl"** 
		else:
			quadkey = self.getQuadKey(col, row, zoom)
			url = url.replace("{QUADKEY}", quadkey)
			**url += "&language=pl"** 

	if self.service == 'WMTS':
		url = self.urlTemplate['BASE_URL']
		if url[-1] != '?' :
			url += '?'
		params = ['='.join([k,v]) for k, v in self.urlTemplate.items() if k != 'BASE_URL']
		url += '&'.join(params)
		url = url.replace("{LAY}", lay.urlKey)
		url = url.replace("{FORMAT}", lay.format)
		url = url.replace("{STYLE}", lay.style)
		url = url.replace("{MATRIX}", self.matrix)
		url = url.replace("{X}", str(col))
		url = url.replace("{Y}", str(row))
		url = url.replace("{Z}", str(zoom))
		**url += "&language=pl"** 

	if self.service == 'WMS':
		url = self.urlTemplate['BASE_URL']
		if url[-1] != '?' :
			url += '?'
		params = ['='.join([k,v]) for k, v in self.urlTemplate.items() if k != 'BASE_URL']
		url += '&'.join(params)
		url = url.replace("{LAY}", lay.urlKey)
		url = url.replace("{FORMAT}", lay.format)
		url = url.replace("{STYLE}", lay.style)
		url = url.replace("{CRS}", str(tm.CRS))
		url = url.replace("{WIDTH}", str(tm.tileSize))
		url = url.replace("{HEIGHT}", str(tm.tileSize))
		**url += "&language=pl"**

		xmin, ymax = tm.getTileCoords(col, row, zoom)
		xmax = xmin + tm.tileSize * tm.getRes(zoom)
		ymin = ymax - tm.tileSize * tm.getRes(zoom)
		if self.urlTemplate['VERSION'] == '1.3.0' and tm.CRS == 'EPSG:4326':
			bbox = ','.join(map(str,[ymin,xmin,ymax,xmax]))
		else:
			bbox = ','.join(map(str,[xmin,ymin,xmax,ymax]))
		url = url.replace("{BBOX}", bbox)

	return url`

@domlysz domlysz added the easyfix label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants