Last active
August 29, 2015 14:17
-
-
Save felixlindemann/732f2601cf8d20797cfc to your computer and use it in GitHub Desktop.
Custom Event: Map.Initialized
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
$("#" + 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