Skip to content

Instantly share code, notes, and snippets.

@felixlindemann
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felixlindemann/732f2601cf8d20797cfc to your computer and use it in GitHub Desktop.
Save felixlindemann/732f2601cf8d20797cfc to your computer and use it in GitHub Desktop.
Custom Event: Map.Initialized
$("#" + olMapControls.map.div).on('initialized', function(){
// add Custom Controls
addControls();
});
function addControls(){
$('#btnZoomIn').click(function (evt) {
evt.preventDefault();
olMapControls.ZoomIn();
});
$('#btnZoomOut').click( function (evt) {
evt.preventDefault();
olMapControls.ZoomOut();
});
// Add Tile-Layers
$.each(olMapControls.Layers.Tiles, function( index, value ) {
if(value.isOverlay == false){
AddButtonToMapStyle("#mapstyles", index, value);
}
});
// Add-Overlays
$.each(olMapControls.Layers.Tiles, function( index, value ) {
if(value.isOverlay == true){
AddButtonToOverlay("#overlays", index, value);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment