text: mapboxgl.accessToken="pk.eyJ1IjoibGVjcnV6MDEiLCJhIjoiY2pyY2t1aXJiMWV3bTQ0bndiZHFtZnd3dCJ9.T_AWHGpxthQg8DRhzuKTGg",fetch("http://192.168.0.100:8000/assets/data/entidades.geojson").then(e=>e.json()).then(e=>{map.on("load",function(){for(var a=[],t=0;t<e.features.length;t++){var o={type:"Feature",geometry:e.features[t].geometry};a.push(o)}map.addSource("escuelas-data",{type:"geojson",data:e}),map.addLayer({id:"ganadores-layer",type:"fill",source:"escuelas-data",paint:{"fill-color":{type:"categorical",property:"G18",stops:[["PT-MORENA-PES","#F00"],["PRI","#0f0"],["PAN-PRD-MC","#00f"],["MORENA","#000"]]},"fill-outline-color":"#fff","fill-opacity":.6}}),map.on("click","ganadores-layer",function(e){console.log(e.features[0]);var a="<h4>"+e.features[0].properties.CABECERA+"</h4><p><strong>Gobernado por:</strong>"+e.features[0].properties.G18+"</p>";(new mapboxgl.Popup).setLngLat(e.lngLat).setHTML(a).addTo(map)}),map.on("click","escuelas-layer",function(e){for(var a=e.features[0].geometry.coordinates.slice(),t="<h4>"+e.features[0].properties.NOMSERV+"</h4><p>"+e.features[0].properties.GEOGRAFICO+" "+e.features[0].properties.TIPO+" "+e.features[0].properties.AMBITO+"</p><em>Estado: "+e.features[0].properties.CONDICION+"</em>";Math.abs(e.lngLat.lng-a[0])>180;)a[0]+=e.lngLat.lng>a[0]?360:-360;(new mapboxgl.Popup).setLngLat(a).setHTML(t).addTo(map)}),map.on("mouseenter","ganadores-layer",function(){map.getCanvas().style.cursor="pointer"}),map.on("mouseleave","ganadores-layer",function(){map.getCanvas().style.cursor=""})})});var bounds=[[-74.04728500751165,40.68392799015035],[-73.91058699000139,40.87764500765852]],map=new mapboxgl.Map({container:"map",style:"mapbox://styles/mapbox/streets-v10",center:[-99.701254,19.294099],zoom:8});