Here's the link to the page...http://www.julieshad.com/weather/cwsu/ zoa_hazards_tile2.html
On Mar 2, 12:30 pm, shadrack <[email protected]> wrote: > I've basically replicated Mike Williams code for some of my tiles that > I'd like to display for the SF Bay Area. My tiles are named as such > using the Photoshop tile cutter script...http://julieshad.com/images/ > mapping/tiles/10_161_391.jpg > > All I'm getting is gray area instead of the tiles that should be > showing. I'm testing it just using one zoom level...10. Is there > something I'm missing? Thanks, > Shad > > And here's the html: > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas- > microsoft-com:vml"> > <head> > <meta http-equiv="content-type" content="text/html; charset=UTF-8"/ > > <title>Google Maps</title> > <script src="http://maps.google.com/maps? > file=api&v=2&key=ABQIAAAAkc_saF95f9yN260PF4w0pRQ_vNqNpq_nXytcTy0ckbgpXx4nuxRMnnzXdv9W5t7SSIvWyEnD9ia5Tw" > type="text/javascript"></script> > </head> > <body onunload="GUnload()"> > > <div id="map" style="width: 800px; height: 600px"></div> > > <a href="custommap.htm">Back to the tutorial page</a> > > <!-- fail nicely if the browser has no Javascript --> > <noscript><b>JavaScript must be enabled in order for you to use > Google Maps.</b> > However, it seems JavaScript is either disabled or not supported > by your browser. > To view Google Maps, enable JavaScript by changing your browser > options, and then > try again. > </noscript> > > <script type="text/javascript"> > //<![CDATA[ > > if (GBrowserIsCompatible()) { > > var map = new GMap(document.getElementById("map")); > map.addControl(new GScaleControl()); > > // > ============================================================ > // == Write our own getTileUrl function ======== > // In this case the tiles are names like 15_8053_5274.jpg > > CustomGetTileUrl=function(a,b){ > if (b==10 && a.x>=161 && a.x<=172 && a.y>=391 && a.y<= 398) { > return "http://julieshad.com/images/mapping/tiles/"+(17-b) > +"_"+a.x+"_"+a.y+".jpg" > } else { > return G_NORMAL_MAP.getTileLayers()[0].getTileUrl(a,b); > } > } > > // ============================================================ > // ====== Create a copyright entry ===== > var copyright = new GCopyright(1, > new GLatLngBounds(new GLatLng(20.8136257,-135.0981445),new > GLatLng(40.8654855,-110.9663944) ), > 10, "Bay Area"); > > // ============================================================ > // ====== Create a copyright collection ===== > // ====== and add the copyright to it ===== > var copyrightCollection = new GCopyrightCollection('Map Data:'); > copyrightCollection.addCopyright(copyright); > > // ============================================================ > // ===== Create the GTileLayer ===== > // ===== adn apply the CustomGetTileUrl to it > var tilelayers = [new GTileLayer(copyrightCollection,10,10)]; > tilelayers[0].getTileUrl = CustomGetTileUrl; > > // ============================================================ > // ===== Create the GMapType ===== > // ===== and add it to the map ===== > > var custommap = new GMapType(tilelayers, > G_SATELLITE_MAP.getProjection(), "Bay Area"); > map.addMapType(custommap); > > map.setCenter(new GLatLng(37.69,-122.336), 10, custommap); > map.addControl(new GLargeMapControl()); > map.addControl(new GMapTypeControl()); > map.enableScrollWheelZoom(); > } > > // 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 > // Blackpool Community Church Javascript Team > //http://www.commchurch.freeserve.co.uk/ > //http://econym.googlepages.com/index.htm > > //]]> > </script> > </body> > > </html> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
