1

In the past days, I have tried to make the inside of those polygons clickable, but I had no success. I can click on lines of that polygon, but not inside it. How can I solve this? I have tried many solutions, but no success.

class ParcelsCoordinates extends Model
{
    protected $table = ['parcels_coordinates'];
    protected $fillable = ['parcels_id', 'lat', 'long'];
}
<script>
    var map = L.mapbox
    .map('map')
    .addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));

    var runLayer = omnivore
    .gpx('{{$gpx->source}}')
    .on('ready', function () {
        map.fitBounds(runLayer.getBounds());
        runLayer.eachLayer(function (layer) {
        let citeste = layer.feature.properties.name;
        let nume = citeste.split(' - ');
        nume = nume[1];
        let id;
        layer.on('click', function () {
            $.ajax({
            type: 'POST',
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            url: '/ajax/identificator',
            data: {
                identificator: nume
            }, //How can I preview this?
            dataType: 'json',
            async: true, //This is deprecated in the latest version of jquery must use now callbacks
            success: function (d) {
                let mesaj = 'Identificator sola: ' + nume;
                mesaj += '<br />Descriere: ' + layer.feature.properties.desc;
                mesaj +=
                '<br /><a href="/iFermier/parcele/administrare/' +
                d[0].id +
                '">Vizitează sola</a>';
                layer.bindPopup(mesaj);
            }
            });
        });
        });
    })
    .addTo(map);
</script>
janw
  • 8,758
  • 11
  • 40
  • 62
Alin
  • 11
  • 3

0 Answers0