Giter VIP home page Giter VIP logo

Comments (1)

realcgslav avatar realcgslav commented on June 11, 2024

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`

from blendergis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.