Created
May 8, 2012 17:54
-
-
Save kconragan/2637953 to your computer and use it in GitHub Desktop.
Google Maps custom tile overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up the copyright information | |
// Each image used should indicate its copyright permissions | |
var myCopyright = new GCopyrightCollection("© "); | |
myCopyright.addCopyright(new GCopyright('Demo', | |
new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)), | |
0,'©2007 Google')); | |
// Create the tile layer overlay and | |
// implement the three abstract methods | |
var tilelayer = new GTileLayer(myCopyright); | |
tilelayer.getTileUrl = function() { return "../include/tile_crosshairs.png"; }; | |
tilelayer.isPng = function() { return true;}; | |
tilelayer.getOpacity = function() { return 1.0; } | |
var myTileLayer = new GTileLayerOverlay(tilelayer); | |
var map = new GMap2(document.getElementById("map_canvas")); | |
map.setCenter(new GLatLng(37.4419, -122.1419), 13); | |
map.addOverlay(myTileLayer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment