const mapjs = M.map({
container: 'map',
layers: ["OSM"],
controls: ["mouse", "layerswitcher"]
});
const maxExtent = [193104.52926740074, 4119420.5399687593, 287161.9825899291, 4164759.1717656343];
const wmc = new M.layer.WMC("http://sigc.desarrollo.guadaltel.es/mapea5/files/wmc/wmcprueba.xml*prueba");
const permeabilidad = new M.layer.WMS("http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?*permeabilidad");
const redesEnergeticas = new M.layer.WMS("WMS*Redes*http://www.ideandalucia.es/wms/mta400v_2008?*Redes_energeticas*true");
const limites = new M.layer.WMS("WMS*Limites*http://www.ideandalucia.es/wms/mta10v_2007?*Limites*true");
const canarias = new M.layer.WMS("WMS*canarias*http://idecan2.grafcan.es/ServicioWMS/MOS?*WMS_MOS*true*false");
const toporaster = new M.layer.WMTS("WMTS*http://www.ideandalucia.es/geowebcache/service/wmts?*toporaster");
const mapbox = new M.layer.Mapbox("MAPBOX*mapbox.streets*true");
const osm = new M.layer.OSM({transparent: true});
const removeLayers = () => mapjs.removeLayers(mapjs.getLayers());
window.prioridadCapa = (evt) => {
M.dialog.info(`
Añadimos una WMS con un maxExtent por parámetro.
`);
const permeabilidadExtent = new M.layer.WMS({
url: "http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?",
name: "permeabilidad",
maxExtent
});
mapjs.addWMS(permeabilidadExtent);
};
window.prioridadWMC = (evt) => {
M.dialog.info(`
Cargamos el WMC de CDAU con el maxExtent global (Andalucía) y con la capa base con un maxExtent específico,
en este caso, mayor que el global.
`);
removeLayers();
const wmctmp = new M.layer.WMC("http://sigc.desarrollo.guadaltel.es/mapea5/files/wmc/wmcprueba.xml*prueba");
mapjs.setBbox([74122.81076839779, 4046156.547951491, 454654.1962325135, 4239791.528992346]);
mapjs.setMaxExtent(undefined);
mapjs.addWMC(wmctmp);
};
window.prioridadMapa = (evt) => {
M.dialog.info(`
3. Parámetro mapa: Si el...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.