[Mapea5] genera geojson rest

KML datos abiertos Ayto. Sevilla bicicletas

by SIGC

HTML

<script src="https://sigc.desarrollo.guadaltel.es/mapea5/js/mapea.ol.min.js"></script>
<script src="https://sigc.desarrollo.guadaltel.es/mapea5/js/configuration.js"></script>
<link rel="stylesheet" href="https://sigc.desarrollo.guadaltel.es/mapea5/assets/css/mapea.ol.min.css">
<div id="map"></div>

CSS

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

JavaScript

let urlGeojson = "http://sevilla.idesevilla.opendata.arcgis.com/datasets/213158e256994ad8813846f032358058_0.geojson";
 let style;
 let extract = true;


 const mapajs = M.map({
   container: "map",
   wmcfile: ["cdau","cdau_satelite"],
   controls: ["layerswitcher", "scale", "scaleline","mouse"],
   bbox: "230193,4134494,245972,4146730"
 });


 let layerGeoJSON = new M.layer.GeoJSON({
   name: "GeoJSON",
   url: urlGeojson
 });


 mapajs.addLayers([layerGeoJSON]);

 style = new M.style.Point({
 /* radius: 5,
  fill: {
    color: 'orange',
    opacity: '0.8'
  },
  stroke: {
     color: 'red',
     width: 1,
   },*/
  icon: {
    src: 'http://datosabiertos.sevilla.org/wp-content/themes/viavansi-ogov/skin/ayto-sevilla/images/layout/maps-marker.png',
    rotation: 0,
    scale: 0.7,
    opacity: 0.6,
    anchor: [0.5, 1],
    rotate: false,
  }
});



// Destacar visualmente la seleccion
let styleSelected;
styleSelected  = new M.style.Point({
  icon: {
    src: 'http://datosabiertos.sevilla.org/wp-content/themes/viavansi-ogov/skin/ayto-sevilla/images/layout/maps-marker.png',
    rotation: 0,
    scale: 2,
    opacity: 1,
    anchor: [0.5, 1],
    rotate: false,
  }
});

layerGeoJSON.on(M.evt.HOVER_FEATURES, function(features){
//let f = features[0];
 features.forEach(function(f){
  f.setStyle(styleSelected);
 });
});

layerGeoJSON.on(M.evt.LEAVE_FEATURES, function(features){
 features.forEach(function(f){
  f.setStyle(style);
 });
});

 layerGeoJSON.setStyle(style);
 //layerGeoJSON.setStyle(new M.style.Cluster({}));