Skip to content

Instantly share code, notes, and snippets.

@Isxida
Created August 22, 2012 15:03
Show Gist options
  • Save Isxida/3426490 to your computer and use it in GitHub Desktop.
Save Isxida/3426490 to your computer and use it in GitHub Desktop.
Mapa ?
var map;
function init() {
//creo el pinche mapa....
map = new OpenLayers.Map({
div: "map",
allOverlays: true
});
//Agrego las capas una es OSM y el otro es de Google
var osm = new OpenLayers.Layer.OSM();
var gmap = new OpenLayers.Layer.Google("Google Streets", {visibility: false});
// Luego acomodo las capas en orden ("osm" primero, "gmap" segundo)
map.addLayers([osm, gmap]);
//Añadir el control para que cambien entre capas
map.addControl(new OpenLayers.Control.LayerSwitcher());
//Añadir Zoom
map.zoomToMaxExtent();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment