TMS - Visicom

  • AllControl
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 1 month 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:
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.

More
12 years 4 weeks ago - 12 years 4 weeks ago #348 by Dima
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
  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
getTileUrl: function(coord, zoom) {

begin of function
function(coord, zoom) {
and the end of function is
	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 4 weeks ago by Dima.

Please Log in or Create an account to join the conversation.

Time to create page: 0.066 seconds

Donate


Go to top