Skip to content

Instantly share code, notes, and snippets.

@brendannee
Created January 18, 2010 07:53
Show Gist options
  • Save brendannee/279873 to your computer and use it in GitHub Desktop.
Save brendannee/279873 to your computer and use it in GitHub Desktop.
Add a custom div to google maps
// 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