var map = L.map("map", {
        zoom: 15,
        center: [-18.539414, -65.427680],
        zoomControl: true,
        attributionControl: false
});

var osm2 = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
			maxZoom: 21
        }).addTo(map);

/*var imagenUrl2 = 'images/YotalaImagen.jpg';
var limiteImagen2 =  [[-19.163586,-65.269078], [-19.157617,-65.262007]];

var raster2 = L.imageOverlay(imagenUrl2, limiteImagen2, {
	//opacity:0.8,
	attribution:'Yotala'}).addTo(mapi);*/

jQuery.ajax({
    type: "POST",
    url: "/jmap2/ficha_catastral/lotes/ident_geo/traer_jsonpredio",
    success: function(res) {
        if (res) {
           // alert(res);
           //alert(res.property);
            $('#jsonpredio').html(res);
        }
    },
    error: function(res) {
        //alert('error');
        $('#jsonpredio').html("ERROR");
                                                                
    }        
                                                
});
var predio = L.geoJson(null, {
    style: function (feature) {
      return {
        color: "green",
        fill: true,
        opacity: 0.4,
        clickable: true
      };
    }
    
    
  }).addTo(map);

  jQuery.ajax({

    type: "POST",
    url: "/jmap2/ficha_catastral/lotes/ident_geo/jsonpredio_mapa",
    datatype: 'json',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      ready: 'ready'
    }),
    success: function(data) {
        if (data) {
           alert(data);
           alert(data.property);
           console.log(data);
           predio.addData(data);
        }
    },
    error: function() {
        alert('error');
        
                                                                
    }        
                                                
});
  
                                     
                                          

 