2

I would like to make a map of the Italian coast using the Google maps API, but the numbers of requests I can make are limited.

I've searched and found "MapServer" but I have some questions. Does Google maps use Mapserver? Are the images included in Mapserver, or are they the property of Google ?

When you zoom, how does the generation of the tiles work? Is it Google maps that does this, or is it in the MapServer API?

user3815389
  • 21
  • 2
  • 6
  • When you zoom, how does the generation of the tiles work? Is it Google maps that does this, or is it in the MapServer API? > Using mapserver and your own spatial database you can generate your own tiles (if you do not wish to use Google maps). Check open source solutions tilecache and openlayers. – Ritesh A Aug 02 '17 at 08:08

3 Answers3

2

Are the images included in Mapserver, or are they the property of Google ?

They belong to google and you use MapServer to request the images.

MapServer has the ability to use the googlemaps API. The googlemaps API sends MapServer the tiles upon request based on zoom level and coordinates (X,Y). So each time you zoom in, a new set of tiles will be requested by MapServer from googlemaps. So, if your requests are limited I imagine you would quickly max out. Any idea how many requests you can make?

Check out the documentation for tiles: http://mapserver.org/output/tile_mode.html#using-google-maps

ConcurrentHashMap
  • 4,998
  • 7
  • 44
  • 53
Zach Russell
  • 328
  • 3
  • 7
0

MapServer support tile generated both Google Map version or Microsoft Bing Map version.

Please check documentation as pointed by @zachatrocity to make sure that your MapServer support PROJ.

That documentation had been written in 2008/04/30, and it's not supported by Google Map JavaScript API anymore.

Current documentation about using your own MapServer tiles as overlay can be found here: https://developers.google.com/maps/documentation/javascript/examples/maptype-base

Follow that sample, but you need to change getTile function provided there into your own tile:

CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
  var url = "http://[change this into your mapserver ip]]/cgi-bin/mapserv.exe?";
  url += "map=/path/to/your/mapfile.map&";
  url += "mode=tile&"; // you need this!
  url += "layers=yourLayer&";
  //url += "layers=layer1 layer2&";
  url += "tilemode=gmap&"; // you need this
  url += "tile=" + coord.x + " " + coord.y + " "+zoom; // and this

  var myMapServerTile = ownerDocument.createElement('img');
  myMapServerTile.src= url;
  return myMapServerTile;

};

see modified preview here

Kampau Ocu
  • 1,131
  • 1
  • 7
  • 4
0

There are multiple ways to handling these kind of tasks. Most of the GIS javascript api on the front end has build in function to calculate the tiles to generate multiple calls (default 16 tiles) based on your tiled map layer. If you open a fiddler or open development tool in your browser, you would see for a single range query( bbox for example), the front end generate multiple wms calls to mapserver. Each of them is one tile.

At the server side, tiles can be pregenerated or be generated on the fly. See MapCache related topics in the official site to get more details if you are interesting to have pregenerated tile cache.

Teng Ma
  • 353
  • 2
  • 9