Prueba GeoJSON
by SIGC GUADALTEL
HTML
<link rel="stylesheet" href="https://mapea4-sigc.juntadeandalucia.es/assets/css/mapea.ol.min.css">
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/js/mapea.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea42_dev/js/configuration.js"></script>
<div id="map">
</div>
CSS
html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
JavaScript
let epsg = "EPSG:4326";
let geoJSON ="http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=tematicos:Provincias&outputFormat=application/json&srsName="+epsg;
//GPS con CRS bien (largo)
geoJSON = "http://www.mocky.io/v2/5afc0e8f3100008d007c5c7b";
//GPS con CRS mal (corto)
//geoJSON="http://www.mocky.io/v2/5afc0fc231000049007c5c83"
lyJSON=new M.layer.GeoJSON({
name: 'prueba',
//crs: "4326",
url: geoJSON
})
mapajs = M.map({
controls:['layerswitcher'],
//projection: 'EPSG:4326*d',
container:"map"
});
mapajs.addLayers(lyJSON);