[Test] GeoJSON 3857

by SIGC GUADALTEL

HTML

<script src="http://mapea4-sigc.juntadeandalucia.es/js/mapea-5.0.1.ol.min.js"></script>
<link rel="stylesheet" href="http://mapea4-sigc.juntadeandalucia.es/assets/css/mapea-5.0.1.ol.min.css">
<script src="http://mapea4-sigc.juntadeandalucia.es/js/configuration-5.0.1.js"></script>
<div id="map"></div>

CSS

html,
body,
#map {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

JavaScript

var mapajs = M.map({
	container:"map",
  wmcfiles:["mapa"],
  controls: ['mouse'],
  projection: 'EPSG:3857*m'
  });
  
  

//proj4.defs("EPSG:3857","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs");

//ol.proj.proj4.register(proj4);


//GeoJSON servido
mapajs.addLayers(new M.layer.GeoJSON({name: "Provincias", url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=tematicos:Provincias&maxFeatures=50&outputFormat=application/json&srsName=EPSG:4258"}));

//GeoJSON local
mapajs.addLayers(new M.layer.GeoJSON({
    source: {"crs":{"properties":{"name":"EPSG:4326"},"type":"name"},"features":[{"properties":{"estado":1,"vendor":{"mapea":{}},"sede":"/Sevilla/CHGCOR003-Oficina de la zona regable del Genil","tipo":"ADSL","name":"/Sevilla/CHGCOR003-Oficina de la zona regable del Genil"},"type":"Feature","geometry":{"type":"Point","coordinates":[-5.278075,37.69374444444444]}},{"properties":{"estado":0,"vendor":{"mapea":{}},"sede":"/Córdoba/CHGCOR014-Presa de Retortillo","tipo":"VSAT","name":"/Córdoba/CHGCOR014-Presa de Retortillo"},"type":"Feature","geometry":{"type":"Point","coordinates":[-5.347761111111111,37.84215833333334]}},{"properties":{"estado":0,"vendor":{"mapea":{}},"sede":"/Córdoba/CHGCOR015-Presa de San Rafael de Navallana","tipo":"3G","name":"/Córdoba/CHGCOR015-Presa de San Rafael de Navallana"},"type":"Feature","geometry":{"type":"Point","coordinates":[-4.629191666666667,37.95544166666667]}},{"properties":{"estado":0,"vendor":{"mapea":{}},"sede":"/Granada/CHGGRA008-Presa de Colomera","tipo":"ADSL","name":"/Granada/CHGGRA008-Presa de Colomera"},"type":"Feature","geometry":{"type":"Point","coordinates":[-3.718202777777778,37.39816111111111]}}],"type":"FeatureCollection"},
    name: 'prueba'
  }));