Created
January 18, 2010 07:53
-
-
Save brendannee/279873 to your computer and use it in GitHub Desktop.
Add a custom div to google maps
This file contains hidden or 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
// Add custom pane | |
function DragPane() {} | |
DragPane.prototype = new GControl; | |
DragPane.prototype.initialize = function(map) { | |
var me = this; | |
me.panel = document.createElement("div"); | |
me.panel.style.width = "400px"; | |
me.panel.style.height = "25px"; | |
me.panel.innerHTML = "<div class='message'>Drag and drop icons to calculate a new route</div>"; | |
map.getContainer().appendChild(me.panel); | |
return me.panel; | |
}; | |
DragPane.prototype.getDefaultPosition = function() { | |
return new GControlPosition( | |
G_ANCHOR_TOP_LEFT, new GSize(80, 5)); | |
}; | |
DragPane.prototype.getPanel = function() { | |
return me.panel; | |
} | |
self.map.addControl(new DragPane()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment