Hi
I am using yahoo usual map and bing aerial map. I am able to create both independently and switch between them. Now I am trying to have yahoo overlay with bing aerial map. I tried using overlay as follows but I am initially getting bing aerial map shortly followed by grey screen. Here is my overlay code I integrated in existing yahoo map file:
public class YahooMap extends EPSG3785 implements GeoMap, UnstreamedMap,MapTileOverlay
{
private boolean isSatView = false;
private int zoom = 0;
//String mapString = "http://png.maps.yimg.com/png?t=m&s=256&f=j&v=4.1";
String mapString = "http://tile.in.maps.yahoo.com/tile?imgtype=png&v=0.95";
String satString = "http://aerial.maps.yimg.com/tile?v=1.4&t=a";
//String satString = "http://aerial.in.maps.yahoo.com/tile?imgtype=png&v=0.93";
public YahooMap()
{
super(new StringCopyright("Yahoo!"), 256, 1, 18);
}
public String buildPath(final int mapX, final int mapY, final int zoom)
{
this.zoom = zoom;
String currentViewString = mapString;
if (isSatView)
{
currentViewString = satString;
}
final StringBuffer url = new StringBuffer(currentViewString);
url.append("&x=");
url.append(mapX / getTileSize());
url.append("&y=");
url.append(((1 << zoom) >> 1) - 1 - mapY / getTileSize());
url.append("&z=");
url.append(18 - zoom);
return url.toString();
}
public void setSat(boolean isSatView)
{
this.isSatView = isSatView;
}
public String getOverlayTileUrl(MapTile tile)
{
int tmpX = tile.getX();
int tmpY = tile.getY();
String currentViewString = mapString;
if (isSatView)
{
currentViewString = satString;
}
final StringBuffer url = new StringBuffer(currentViewString);
url.append("&x=");
url.append(tmpX / getTileSize());
url.append("&y=");
url.append(((1 << zoom) >> 1) - 1 - tmpY / getTileSize());
url.append("&z=");
url.append(18 - zoom);
return url.toString();
}
}
Please help how to achieve yahoo map overlay on bing. Is it because bing tiles are not transparent? If so, what is the tile url parameter to set transparancy?
Regards
Parthiban Rajendran
Right, overlay tile must be transparent. URL parameter question is more likely question to Bing/MS.
/JaakL