Everything went fine till I tried to provide my own map layer. What I
do, basically, is:
in my class CityMap, I create and add a new map type
protected void initMap(){
if(!mapTypeAdded){
map.addMapType(createMapType());
mapTypeAdded = true;
}
super.initMap();
}
private GMapType createMapType(){
GCopyrightCollection cc = GCopyrightCollection.create();
cc.addCopyright(GCopyright.create(1111,
GLatLngBounds.create(GLatLng.create(-90, -180),
GLatLng.create(90, 180)), 10, "Some copyright"));
GTileLayer[] layers = new GTileLayer[1];
layers[0] = GTileLayer.create(cc, getMinZoom(), getMaxZoom());
configureTileLayer(layers[0], this);
GMapType type = GMapType.create(layers,
GMercatorProjection.create(18), "Scan");
return type;
}
where in configuretileLayer I have to attach my GWT code to maps JS
code to provide tile urls, and this is where I think the problem sits
(although I can't see why)
public static native void configureTileLayer(GTileLayer layer, CityMap
cityMap)/*-{
layer.getTileUrl =
function(t,z){cityMap.@org.saddamlennon.socialMaps.client.ui.maps.CityMap::getTileUrl(Lcom/mapitz/gwt/googleMaps/client/GPoint;I)(t,z);};
layer.isPng = function(){ return true; };
layer.getOpacity = function(){ return 1; };
}-*/;
and the method I attach is
public String getTileUrl(GPoint point, int zoom){
tile.x = point.getX();
tile.y = point.getY();
tile.zoomLevel = zoom;
String path = cityFullInfo.mapTiles.contains(tile)
? gwtBase+"maps/"+
cityFullInfo.city.customMapFolder+"/"+
tile.zoomLevel+"_"+tile.x+"_"+tile.y+".png"
: gwtBase+"maps/no.png";
GWT.log("custom tile: "+path, null);
return path;
}
now, my getTileUrl gets called, i can see lost of similar lines in
development shell log:
[INFO] custom tile:
http://localhost:8888/org.saddamlennon.socialMaps.SocialMaps/maps/pieszyce/17_71576_44042.png
and i know that all these files sit on the server (it's enaough to pate
the link to the browser and the image loads)
However, both in development shell and in compiled mode my tiles don't
appear on the map.
In the compiled mode I'm getting this javascript error:
Error: a has no properties
Source File: http://maps.google.com/mapfiles/maps2.68.api.js
Line: 257
and the line 257 says:
function Me(a){return a.substring(a.length-wa.length)==wa}
I know that wa is the url of the transparent tile from google in maps
code.
Do you have any idea what may be wrong here? Can I get uncompressed
version of maps library so that i can debug it?
cheers, greg