function addWellsToMapCluster() {
  if (gwWells.data) {
    //create a cluster group
    if (lyrWellsInAquiferGroup) {
      map.removeLayer(lyrWellsInAquiferGroup);
      lyrWellsInAquiferGroup.clearLayers();
    }

    lyrWellsInAquiferGroup = L.markerClusterGroup({ disableClusteringAtZoom: 14 });

    lyrWellsInAquifer = L.geoJSON(gwWells.data,{
      onEachFeature: function(feature, layer) {
        layer.on({
          click: wellsInAquiferPopup
        })
      },
      //call function to set well point style options
       pointToLayer: function (feature, latlng){
        var clr = 'blue';
        var att = feature.properties;
        switch (att.WELL_LICENCE_GENERAL_STATUS) {
          case 'LICENSED':
            clr = 'rgb(25, 78, 158)';
            break;
          case 'UNLICENSED':
            clr = 'rgb(104, 153, 185)';
            break;
        }
        if (att.MINISTRY_OBSERVATION_WELL_STAT == 'Active'){clr = 'rgb(189, 41, 41)'};
        
        var markerOptions = {radius:4, color:clr, fillColor:clr, fillOpacity:0.8};
        var marker = L.circleMarker(latlng, markerOptions);
        //console.log("creating custom well marker :" + clr.toString() + "  " + feature.properties.WELL_TAG_NUMBER);
        return marker;
        }
    });

    lyrWellsInAquiferGroup.addLayer(lyrWellsInAquifer);
    lyrWellsInAquiferGroup.addTo(map);
    console.log("wells added !!!")
    } else {
    //let the user know the feature was not found somehow.
    console.log("**** Wells Data not found ****");
    };
}
//add the wells inside an aquifer, called from make a graph doStuffWithWells()
add the wells inside an aquifer, called from make a graph doStuffWithWells()
add the wells inside an aquifer called from make a graph doStuffWithWells ()
function addWellsToMapCluster() {
  if (gwWells.data) {
    if (lyrWellsInAquiferGroup) {
      map.removeLayer(lyrWellsInAquiferGroup);
      lyrWellsInAquiferGroup.clearLayers();
    }
    lyrWellsInAquiferGroup = L.markerClusterGroup({ disableClusteringAtZoom: 14 });
    lyrWellsInAquifer = L.geoJSON(gwWells.data,{
      onEachFeature: function(feature, layer) {
        layer.on({
          click: wellsInAquiferPopup
        })
      },
       pointToLayer: function (feature, latlng){
        var clr = 'blue';
        var att = feature.properties;
        switch (att.WELL_LICENCE_GENERAL_STATUS) {
          case 'LICENSED':
            clr = 'rgb(25, 78, 158)';
            break;
          case 'UNLICENSED':
            clr = 'rgb(104, 153, 185)';
            break;
        }
        if (att.MINISTRY_OBSERVATION_WELL_STAT == 'Active'){clr = 'rgb(189, 41, 41)'};
        var markerOptions = {radius:4, color:clr, fillColor:clr, fillOpacity:0.8};
        var marker = L.circleMarker(latlng, markerOptions);
        return marker;
        }
    });
    lyrWellsInAquiferGroup.addLayer(lyrWellsInAquifer);
    lyrWellsInAquiferGroup.addTo(map);
    console.log("wells added !!!")
    } else {
    console.log("**** Wells Data not found ****");
    };
}
function addWellsToMapCluster ( ) { if ( gwWells . data ) { if ( lyrWellsInAquiferGroup ) { map . removeLayer ( lyrWellsInAquiferGroup ) ; lyrWellsInAquiferGroup . clearLayers ( ) ; } lyrWellsInAquiferGroup = L . markerClusterGroup ( { disableClusteringAtZoom : 14 } ) ; lyrWellsInAquifer = L . geoJSON ( gwWells . data , { onEachFeature : function ( feature , layer ) { layer . on ( { click : wellsInAquiferPopup } ) } , pointToLayer : function ( feature , latlng ) { var clr = 'blue' ; var att = feature . properties ; switch ( att . WELL_LICENCE_GENERAL_STATUS ) { case 'LICENSED' : clr = 'rgb(25, 78, 158)' ; break ; case 'UNLICENSED' : clr = 'rgb(104, 153, 185)' ; break ; } if ( att . MINISTRY_OBSERVATION_WELL_STAT == 'Active' ) { clr = 'rgb(189, 41, 41)' } ; var markerOptions = { radius : 4 , color : clr , fillColor : clr , fillOpacity : 0.8 } ; var marker = L . circleMarker ( latlng , markerOptions ) ; return marker ; } } ) ; lyrWellsInAquiferGroup . addLayer ( lyrWellsInAquifer ) ; lyrWellsInAquiferGroup . addTo ( map ) ; console . log ( "wells added !!!" ) } else { console . log ( "**** Wells Data not found ****" ) ; } ; }
add the wells inside an aquifer, called from make a graph doStuffWithWells()
add the wells inside an aquifer called from make a graph doStuffWithWells ()
//create a cluster group //call function to set well point style options //console.log("creating custom well marker :" + clr.toString() + "  " + feature.properties.WELL_TAG_NUMBER); //let the user know the feature was not found somehow.