Hi!
I'm trying to put my own custom map.
I read this tutorial -> http://econym.org.uk/gmap/index.htm
but i cant' understand the tile organization.
If it's right, there's an organization by zoom level: a zoom level
have his set of tiles for the map and different zoom level have
another set of tiles for the same map but with more or less zoom than
the first.
So, i splitted my map (i used a simple image to try it) and i got
three rows and four columns; i called them "mountain_xxxx_yyyy_3.jpg":
- xxxx means the x axis, for example 0001 for the first column, 0002
the second, etc...
- yyyy means the y axis, for example 0001 for the first row, 0002 the
second, etc...
- 3 is the zoom level;
This is the code i used:
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
var map = new GMap(document.getElementById("map"));
map.addControl(new GScaleControl());
function CustomGetTileUrl(a,b) {
if (b==14) {
return "tiles/mountain_"+a.x+"_"+a.y+"_"+(17-b)+".jpg"
} else {
return "blank.jpg";
}
}
var copyCollection = new GCopyrightCollection('Chart');
var copyright = new GCopyright(1,
new GLatLngBounds(new GLatLng(53.8136257,-3.0981445),new
GLatLng(53.8654855,-2.9663944) ),
14, "Ordnance Survey");
var tilelayers = [new GTileLayer(copyrightCollection,14,14)];
tilelayers[0].getTileUrl = CustomGetTileUrl;
var custommap = new GMapType(tilelayers, new GMercatorProjection
(15), "Old OS");
map.addMapType(custommap);
map.setCenter(new GLatLng(53.852,-3.038), 14, custommap);
}
// display a warning if the browser was not compatible
else {
alert("Sorry, the Google Maps API is not compatible with this
browser");
}
// This Javascript is based on code provided by the
// Community Church Javascript Team
// http://www.bisphamchurch.org.uk/
// http://econym.org.uk/gmap/
//]]>
</script>
But i get only an empty google map screen :/
Take a look at CustomGetTileUrl: i think the problem is there and on
the latitude and longitude; i don't understand how are related
longitude and latitude with the images.
Thank you!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---