--> */ function NMap(params) { //initialize a map, zoomSnap enables smaller zoom intervals, intial view is center of texas. 5.75 is initial zoom level let map = L.map("ecoregion_map", { zoomSnap: 0.25 }).setView( [31.75, -99.9], 5.75 ); //select a tile layer //https://leaflet-extras.github.io/leaflet-providers/preview/ L.tileLayer( "https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}", { maxZoom: 15, minZoom: 5, attribution: "Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community", } ).addTo(map); //prevents map pins that overlap from being hidden //https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet const OMS = new OverlappingMarkerSpiderfier(map); // ZIP CODE lookup API link // https://www.geonames.org/ const zipLookupURL = "http://api.geonames.org/postalCodeSearchJSON?username=jlienhard&country=US&postalcode="; // Address lookup API link // https://geocoding.geo.census.gov/geocoder/ const addressLookupURL = "https://geocoding.geo.census.gov/geocoder/locations/onelineaddress?benchmark=2020&format=json&address="; //additional options for map icons // https://github.com/masajid390/BeautifyMarker const iconOptions = { borderWidth: 3, iconShape: "marker", iconSize: [30, 30], iconAnchor: [15, 30], innerIconAnchor: [0, 5.5], }; //add texas boundry geojson to map L.geoJSON(texasGeo, { style: { weight: "5", fillOpacity: 0, color: "#3c5799" }, }).addTo(map); //add layer controller to map. this is used for the layer toggle checkboxes const layerControl = L.control .layers(null, null, { collapsed: false }) .addTo(map); /* This will create a legend based on the level 3 ecoregions. It will be loaded if either the level 3 ecoregion or level 4 ecoregions are loaded. If both ecoregions are not shown by default, this will be minimized on load. */ if (params.eco3Load === true || params.eco4Load === true) { //add legend to map const level3legend = L.control({ position: "bottomright" }); //add legend level3legend.onAdd = function (map) { const div = L.DomUtil.create("div", "lvl3legend"); const items = L.DomUtil.create("div", "legend-items"); div.appendChild(items); items.innerHTML += "
Level 3 Ecoregions Loading
${ecoregion.info}
Reference: Griffith, Bryce, Omernick & Rodgers (2007). Ecoregions of Texas.`); l3sidebar.show(); }) .addTo(level3Layer); } //add the layer to the map if (params.eco3Show === true) { map.addLayer(level3Layer); } //add layer to overlay so it can be toggled layerControl.addOverlay(level3Layer, "Level 3 Ecoregions"); }); }; loadLevel3Ecos(); //initialize sidebar const l3sidebar = L.control.sidebar("l3sidebar", { position: "left", }); //add controls to sidebar map.addControl(l3sidebar); } /* *eco4Load* will load the level 3 ecoregion data. Must be TRUE in order for eco4Show to work. *eco4Show* will automatically populate the map with the level 4 ecoregions. If not selected, the ecoregions & legend (for level 3 ecoregions) will load, but will be toggled off & minimized respectively. */ if (params.eco4Load === true) { //initialize ecoregion layer const level4Layer = new L.layerGroup(); //add loading spinner while ecoregions load document.querySelector("#ecoregion_map").insertAdjacentHTML( "afterend", `Level 4 Ecoregions Loading
${ecoregion.info}
Reference: Griffith, Bryce, Omernick & Rodgers (2007). Ecoregions of Texas.`); l4sidebar.show(); }) .addTo(level4Layer); } if (params.eco4Show === true) { //add the layer to the map map.addLayer(level4Layer); } //add layer to overlay so it can be toggled layerControl.addOverlay(level4Layer, "Level 4 Ecoregions"); }); }; loadLevel4Ecos(); const l4sidebar = L.control.sidebar("l4sidebar", { position: "right", }); map.addControl(l4sidebar); } /* *chapterLoad* will load the chapter location pins & chapter counties to create a "heatmap". Must be TRUE in order for chapterShow to work. *chapterShow* will automatically populate the map with the chapter location pins & chapter counties. If not selected, the chapter location pins & chapter counties will load but will be toggled off. */ if (params.chapterLoad === true) { const loadChapters = async () => { const chapterOptions = { ...iconOptions }; chapterOptions.borderColor = "#3c5799"; chapterOptions.textColor = "#3c5799"; chapterOptions.icon = "users"; //initialize layer for chapter pins const chapterPins = new L.LayerGroup(); //initialize layer for chapter counties const chapterCounties = new L.LayerGroup(); //storage for chapter counties const countyArr = []; //add loading spinner while ecoregions load document.querySelector("#ecoregion_map").insertAdjacentHTML( "afterend", `Chapters Loading
${ele.title.rendered} Chapter
`; let popup = `${ele.acf.ch_tag}
${ ele.acf.ch_email === "" ? "" : `Email Us${nursery.title.rendered}
`; //build popup let popup = `We Ship!
" : "" } Visit our Homepage`; if (nursery.acf.map_item_associated_organization) { popup += `Associated Chapters
`; nursery.acf.map_item_associated_organization.forEach((ele) => { const chapter = ele.replace(/ +/g, "-").toLowerCase(); popup += `${ele}${garden.title.rendered}
`; //build popup let popup = `Address: ${ garden.acf.map_item_loc.address }
Learn about this garden ${ garden.acf.map_item_external_url ? `Associated Chapters
`; garden.acf.map_item_associated_organization.forEach((ele) => { const chapter = ele.replace(/ +/g, "-").toLowerCase(); popup += `${ele}${garden.title.rendered}
`; //build popup let popup = `Address: ${ garden.acf.map_item_loc.address }
${ garden.acf.map_item_exit_number ? `Exit: ${garden.acf.map_item_exit_number}
` : "" }Associated Chapters
`; garden.acf.map_item_associated_organization.forEach((ele) => { const chapter = ele.replace(/ +/g, "-").toLowerCase(); popup += `${ele}${garden.title.rendered}
`; //build popup let popup = `Address: ${ garden.acf.map_item_loc.address }
Learn about this garden ${ garden.acf.map_item_external_url ? `Associated Organizations
`; garden.acf.map_item_associated_organization.forEach((ele) => { popup += `${ele}
`;
});
}
const marker = L.marker(
[garden.acf.map_item_loc.lat, garden.acf.map_item_loc.lng],
{
icon: L.BeautifyIcon.icon(gardenOptions),
}
)
.addTo(gardenPins)
.bindTooltip(tooltip)
.bindPopup(popup);
OMS.addMarker(marker);
}
map.addLayer(gardenPins);
layerControl.addOverlay(
gardenPins,
" Native Plant Gardens"
);
};
loadNativeGarden();
}
};
fetchMapData();
if (
params.eco3Show !== true &&
params.eco4Show !== true &&
params.chapterLoad !== true
) {
document.querySelector(".spinner-container").hidden = true;
}
}
/*
*speaker* will load & show the speaker locations.
*/
if (params.speaker === true) {
const url = "https://npsot.org/wp-json/wp/v2/speaker_bureau/?per_page=100";
const speakerArr = [];
const fetchSpeakerData = async () => {
try {
let speakerRes = await fetch(url);
let speakerJSON = await speakerRes.json();
speakerArr.push(speakerJSON);
} catch (error) {
console.log(error);
}
const speakerData = await Promise.all(speakerArr);
if (params.speaker) {
//initialize layer for speaker pins
const OMS = new OverlappingMarkerSpiderfier(map);
const speakerPins = new L.LayerGroup();
const speakerOptions = { ...iconOptions };
speakerOptions.icon = "graduation-cap";
speakerOptions.textColor = "#C41E3A";
speakerOptions.borderColor = "#C41E3A";
speakerOptions.backgroundColor = "rgba(255,255,255,0.8)";
const allSpeakers = speakerData[0].filter(
(ele) => ele.acf.speaker_post_type === "Speaker"
);
for (speaker of allSpeakers) {
//build tooltip
let tooltip = `
${speaker.title.rendered}
`; //build popup let popup = `Lives in ${ speaker.acf.speaker_location.city }
${ speaker.acf.driving_distance > 1 ? `Speaker will drive ${speaker.acf.driving_distance} miles
` : "Speaker does not travel
" } View this Speaker's Info`; if (speaker.acf.speaker_affiliation) { let speakerAffiliations = speaker.acf.speaker_affiliation.split(", "); popup += `Associated Organization${ speakerAffiliations.length > 1 ? "s" : "" }
`; speakerAffiliations.forEach((ele) => { popup += `${ele}
`; }); } const marker = L.marker( [ speaker.acf.speaker_location.lat, speaker.acf.speaker_location.lng, ], { icon: L.BeautifyIcon.icon(speakerOptions), } ) .addTo(speakerPins) .bindTooltip(tooltip) .bindPopup(popup) .on("click", function (e) { const regex = /"([^"]*)"/g; const data = e.target._tooltip._content.match(regex); const circle = L.circle( [data[1].slice(1, -1) * 1, data[2].slice(1, -1) * 1], { color: "#C41E3A", radius: data[0].slice(1, -1) * 1609, } ).addTo(map); circle.on("click", () => { circle.remove(); }); }); OMS.addMarker(marker); } map.addLayer(speakerPins); layerControl.addOverlay( speakerPins, " Speakers Bureau" ); } }; fetchSpeakerData(); if ( params.eco3Show !== true && params.eco4Show !== true && params.chapterLoad !== true ) { document.querySelector(".spinner-container").hidden = true; } } } //this toggles the legend when the toggle legend button is clicked const toggleLegend = () => { const legend = document.querySelector(".legend-items"); legend.style.display === "none" ? (legend.style.display = "block") : (legend.style.display = "none"); }; Skip to contentThe monthly meeting will be live at TWU (see link to map below) and simultaneously broadcast via Zoom (see Zoom link below)
6:30 pm Refreshments & socializing
7:00 pm brief business meeting with program to follow.
Our June program-Sex in the Garden-will be presented by Janet Smith. Janet is a Texas Master Gardener, a Master Naturalist and a member of NPSOT.
Janet Will reveal the secrets of garden life and pollination in this educational and entertaining photo-rich presentation.
It will give you a whole new perspective on what flowers do to lure insects and others to assure their future.
Janet is a recovering plantaholic who considers the Master Gardener, Master Naturalist and native plant training as her 12-step program. She specializes in creating attractive landscapes that conserve natural resources and money; are good for the local ecology; and attract bees, butterflies, and birds. She loves helping others discover the thrill of having their own nature channel out their windows.
Janet’s love of gardening didn’t start until after she took early retirement and decided to spruce up her dismal landscape. The next year she took the Master Gardening training and learned how to actually grow and care for plants. She embraced the concept of WaterWise Earth-Kind Gardening in her landscape and as a speaker. A few years later she became a Master Naturalist and joined the Native Plant Society of Texas where she now coordinates their very active Native Landscape Certification.
Janet received a BA in Russian and Spanish from the University of Arizona
Program.
Location: The Ann Stuart Science Complex (ASSC) Room 259 at TWU
Campus Map
Parking is available beginning at 6pm.
Zoom:https://us02web.zoom.us/j/83237641371?pwd=dzhGUlptdnowQk1XQ29iby9LbFYydz09
Meeting ID: 832 3764 1371 Passcode: 107836 One tap mobile +13462487799,,83237641371#,,,,*107836# US (Houston) +17193594580,,83237641371#,,,,*107836# US