Using Custom MapType with Google Maps API
- by Pat Long - Munkii Yebee
I realise there are a couple of examples such as Maoki's Add Your Own Custom Map and Mike Williams' [link text][Google Maps API Tutorial] however I have looked at these and still end up with a Grey box.
The API will not call my "getTileUrl" callback function. This is the javascript I am using
var map = new GMap2(document.getElementById("map"));
map.setUIToDefault();
var copyCollection = new GCopyrightCollection('Map Data:');
var copyright = new GCopyright(1, new GLatLngBounds(new GLatLng(-90, -180), new GLatLng(90, 180)), 0, "©2006 RunwayFinder.com");
copyCollection.addCopyright(copyright);
var tilelayers = [new GTileLayer(copyCollection, 3, 11)];
tilelayers[0].getTileUrl = function (a, b) {
var z = 17 - b;
var f = "http://localhost:25213/test.jpg?x=" + a.x + "&y=" + a.y + "&zoom=" + z + "&width=100&height=100";
return f;
};
var custommap = new GMapType(tilelayers, new GMercatorProjection(12), "Chart", { errorMessage: "No chart data available" });
map.addMapType(custommap);
Can anyone see what it is i am doing wrong?