Skip to content

Instantly share code, notes, and snippets.

@dbouwman
Created July 26, 2013 13:30
Show Gist options
  • Save dbouwman/6088857 to your computer and use it in GitHub Desktop.
Save dbouwman/6088857 to your computer and use it in GitHub Desktop.
Helper that injects a div into the page creates an esri.Map and fires a callback when that map is loaded.
//helper that injects a div, creates a map and
//fires a callback when it's ready to roll
function createTestMap(divId, mapReadyCallback){
$("body").append("<div id='" + divId + "' style='height:400px;width:400px'></div>");
var map = new esri.Map(divId,{
basemap:"topo",
center:[-122.45,37.75],
zoom:13,
sliderStyle:"small"
});
dojo.connect(map,'onLoad', function(theMap){
mapReadyCallback(theMap);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment