Using Custom MapType with Google Maps API
Posted
by Pat Long - Munkii Yebee
on Stack Overflow
See other posts from Stack Overflow
or by Pat Long - Munkii Yebee
Published on 2010-04-19T08:09:42Z
Indexed on
2010/04/19
8:13 UTC
Read the original article
Hit count: 349
google-maps
|google-maps-api
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?
© Stack Overflow or respective owner