RAD Módulo MANUAL
Base   |   Ejemplo Informe   |   Ejemplo Mapa   |   Ejemplo Grafico

<?php
if (eregi(basename(__FILE__), $PHP_SELF)) die ("Security Error ...");

include_once ("header.php");

global $latitudcenter, $longitudcenter, $zoom, $RAD_dbi;
if ($latitudcenter=="") $latitudcenter=40;
if ($longitudcenter=="") $longitudcenter=-4;
if ($zoom=="") $zoom=5;

// Aqui se podria leer una tabla con datos de latitud y longitud para mostrar en el mapa mediante marcas (L.marker)

// A partir de aqui el html del Mapa
?>
<link rel='stylesheet' href='images/leaflet/leaflet.css' />
<link rel='stylesheet' href='images/leaflet/leaflet.tooltip.css'>
<script src='images/leaflet/leaflet.js'></script>
<script src='images/leaflet/leaflet.wms.min.js'></script>
<script src='images/leaflet/leaflet.tooltip.js'></script>
<script type="text/javascript">
//<![CDATA[
var map;
function onLoad() {
  var Streets=L.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}", {maxZoom:19, attribution: " Esri"});
  var Imagery=L.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {maxZoom:20, attribution: " Esri"});
  var OpenTopoMap=L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", { maxZoom: 32, attribution: "OpenStreetMap" });
  var OrtoFoto=L.tileLayer.wms("https://www.idee.es/wms/PNOA/PNOA?SERVICE=WMS&FORMAT=image/jpeg&", { layers: "pnoa", format: "image/jpeg", transparent: false, continuousWorld : true, attribution: "Inst. Geog. Na
cional", maxZoom: 22 });
  var OrtoFoto = L.tileLayer.wms("https://www.ign.es/wms-inspire/pnoa-ma", {layers: "OI.OrthoimageCoverage", format: "image/png", transparent: true, maxZoom: 25 });
  var SIGPAC=L.tileLayer.wms("https://sigpac.mapama.gob.es/SDG/wmts/wmtsservice.aspx", { layers: "ortofotos", transparent: false, continuousWorld : true, attribution: "SIGPAC", maxZoom: 22 });
  var OpenStreetMap=L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {attribution: "OpenStreetMap", maxZoom: 19, subdomains: ["a","b","c"]});
  var Comercial=L.tileLayer("http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png", { attribution: "OpenStreetMap" });
  var MapCities=L.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png", { attribution: "OpenStreetMap - CartoDB", subdomains: "abcd", maxZoom: 30 });
  var CodPostal=L.tileLayer.wms("https://www.cartociudad.es/wms-inspire/direcciones-ccpp?", { layers: "codigo-postal", format: "image/png", transparent: true, maxZoom: 30 });
  var CartoCiudad=L.tileLayer("https://www.ign.es/wmts/ign-base?service=WMTS&request=GetTile&version=1.0.0&Format=image/png&layer=IGNBaseOrto&style=default&tilematrixset=GoogleMapsCompatible&TileMatrix={z}&TileR
ow={y}&TileCol={x}", {maxZoom: 20, minZoom: 1, scheme: "xyz", continuousWorld: true });
  var baseLayers = { "Calles":Streets, "OpenStreet":OpenStreetMap, "Comercial":Comercial,"Topografico":OpenTopoMap, "OrtoFoto":OrtoFoto, "Satelite":Imagery };
  var overlays = { "Calles y Num.": CartoCiudad, "Poblaciones": MapCities, "Cod. Postales": CodPostal }
  // map=L.map("map", {center:[42.119135859164680,-8.849406838417053],zoomControl:false,zoom:11,layers:[Streets]});
  map=L.map("map").setView(['<?php echo $latitudcenter; ?>','<?php echo $longitudcenter; ?>'], '<?php echo $zoom; ?>');
  L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png", { maxZoom:18, attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' }).addTo(map);
  var lcontrol=L.control.layers(baseLayers, overlays).addTo(map);

  L.marker([43.370959688125495,-8.395882844924929],{tooltip:{html:'<b>A Coruña</b>'}}).addTo(map); // marcas de ejemplo
  L.marker([40.415391180324775,-3.707475364208222],{tooltip:{html:'<b>Madrid</b>'}}).addTo(map);
}
//]]>
</script>
<style>
.leaflet-control-layers-base, .leaflet-control-layers-overlays { text-align: left; }
</style>
<script type="text/javascript">
setTimeout('onLoad()',100); // para cargar el mapa despues de cargar el div del mapa
</script>
<div id="map" style="margin: 0px; width:100vw; height:55vh; z-index:2;"></div>

<?php
// para finalizar, se invoca el pie de RAD
include_once ("footer.php");

return;
?>