1

With google maps api, I'm trying to put a custom XYZ service on top of google satellite 3d view (45°). Is it possible?

I have a mapnik stack server serving a custom tile XYZ service (transparent polygons) to be consumed by a google maps api application using:

this.tileLayer = new google.maps.ImageMapType({
  getTileUrl(coord, zoom) {
    return [this.tileURL, zoom, '/', coord.x, '/', coord.y, '.png'].join('');
  },
  tileSize: new google.maps.Size(256, 256),
});

This service is working for scales from 9 to 18 and google maps 3d view is set to work at scale 18. But when I reach scale 18, gmaps api automatically switches to 3d view (setTilt(45)) and starts requesting the custom tiles at scale 18, but they're not displayed. Although, google maps satellite images are displayed well and in 3d.

I don't know why but gmaps api requests non-existent tiles, basically having wrong Y value. For example, it requests "18/140819/99179" instead of "18/140819/85969". Therefore, there is not tile to present.

Is there any way to program gmaps api to do on-the-fly tilting (45°) and display a custom tile service?

Ps.: I tried to force the getTileUrl to return this specific fixed tile, but gmaps api doesn't tilt it.

getTileUrl(coord, zoom) {
  if (zoom === 18 && coord.x === 140819 && coord.y === 99179) {
    return this.tileURL + '/18/140819/85969.png';
  }
  return [this.tileURL, zoom, '/', coord.x, '/', coord.y, '.png'].join('');
}

not tilted tile but in the right place

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.