S
S
stilg2011-04-22 15:04:19
Google
stilg, 2011-04-22 15:04:19

How in api map google v3 not to show tiles that fall under mine?

Didn't think of anything better than intercepting getTile completely.
Here is a section of the code of my example converted from code.google.com/intl/ru/apis/maps/documentation/javascript/maptypes.html (section "Base Map Types").

CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
	var div = ownerDocument.createElement('DIV');
	div.style.width = this.tileSize.width + 'px';
	div.style.height = this.tileSize.height + 'px';
	if(*check for my site or not mine*){
		div.innerHTML = "<img src='http://site.ru/"+zoom+"-tile-"+coord.x+"-"+coord.y+".png'>";
	} else {
		div.innerHTML = "<img src='http://mt1.google.com/vt/[email protected]&hl=en&x=" + coord.x + "&y=" + coord.y + "&z=" + zoom + "&s=Gali'>";
	}
	return div;
};


There is a need for this ... when drawing a section of the map, Google tiles come out faster and are visible for some time before my tiles are drawn.

I think that this is not correct, since the addresses of Google tiles may change. My version works, but for how long.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question