- Posts: 1
- Thank you received: 0
TMS - Visicom
- AllControl
- Topic Author
- Offline
- New Member
Less
More
12 years 7 months ago #346
by AllControl
TMS - Visicom was created by AllControl
Hi Dmitriy! I tried to add custom map, but cann't find right get tile url function
If locate suach code:
it shows map but incorrect way
If locate suach code:
Code:
function(ll, z) {
var X = (1 << z) % ll.x; /* wrap */
return "http://tms1.visicom.ua/1.0.3/world_ru/" + z + "/" + X + "/" + ll.y + ".png";
}
it shows map but incorrect way
Please Log in or Create an account to join the conversation.
- Dima
- Offline
- Platinum Member
12 years 7 months ago - 12 years 7 months ago #348
by Dima
Don't forget support my developments: post review in JED , donate , help with translation
Replied by Dima on topic Re: TMS - Visicom
Hi.
When you take a map image, and create tiles by a program, you get not only tiles folder (with images) but also a html-file to show your map. Open it and find this function.
Check zhuk.cc/wiki/index.php/Zh_GoogleMap_CustomMapType
You can see
In this case the function in that place
begin of function
and the end of function is
And in your file find getTileUrl: - after that - your's function
When you take a map image, and create tiles by a program, you get not only tiles folder (with images) but also a html-file to show your map. Open it and find this function.
Check zhuk.cc/wiki/index.php/Zh_GoogleMap_CustomMapType
You can see
Code:
var gallPetersMapType = new google.maps.ImageMapType({
getTileUrl: function(coord, zoom) {
var numTiles = 1 << zoom;
// Don't wrap tiles vertically.
if (coord.y < 0 || coord.y >= numTiles) {
return null;
}
// Wrap tiles horizontally.
var x = ((coord.x % numTiles) + numTiles) % numTiles;
// For simplicity, we use a tileset consisting of 1 tile at zoom level 0
// and 4 tiles at zoom level 1.
var baseURL = 'images/';
baseURL += 'gall-peters_' + zoom + '_' + x + '_' + coord.y + '.png';
return baseURL;
},
tileSize: new google.maps.Size(800, 512),
minZoom: 0,
maxZoom: 1,
name: 'Gall-Peters'
});
In this case the function in that place
Code:
getTileUrl: function(coord, zoom) {
begin of function
Code:
function(coord, zoom) {
Code:
return baseURL;
}
And in your file find getTileUrl: - after that - your's function
Don't forget support my developments: post review in JED , donate , help with translation
Last edit: 12 years 7 months ago by Dima.
Please Log in or Create an account to join the conversation.
Time to create page: 0.177 seconds