{
var mymap = L.map('mapid').setView([41.9049617,-99.6452142], 7);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
maxZoom: 18,
id: 'mapbox.outdoors',
accessToken: 'pk.eyJ1IjoiY29kYW5iYXIiLCJhIjoiY2syaHg4ZGs4MGY1MDNtbGlkeWV4YmpnMyJ9.Rv6IL_aRXHNjKcw2irDz3g'
}).addTo(mymap);
}
}
*/
// If we want a bolded header
//"<strong>" and then "</strong>"
// If we want a bold header with color
//"<strong style='color: #84b819'>" and then "</strong style>"
/*
// Populate the map with markers with images from your data - we're still looping through each row
function addPoints(data, tabletop) {
for (var row in data) {
var marker = L.marker([
data[row].lat,
data[row].long
]).addTo(mymap);
// Now we're adding popups - plain version, bolded and colored
marker.bindPopup("<p>" + data[row].market_name + "<br/>" + data[row].operation + "<br/>" + data[row].weekday + "<br/>" + "<img src='" + data[row].image_url + "' height='100' />" + "</p>");
// Note that the Google Sheet that data[row].image_url is pulling from is pulled from every time, so you can modify the images in the Google Sheet without having to mess with the code. But if the Google Sheet info disappears, the code won't be able to pull the images/data/whatever.
}
}
*/
// If we want other images for our icons
// Specify marker style
/*
var LeafIcon = L.Icon.extend({
options: {
// iconSize: [25, 41],
iconAnchor: [12, 30],
// adjust iconAnchor if the icon appear to be floating above, below, or to the side of the actual point on the map (lat and long) that you are trying to mark on the map
popupAnchor: [1, -34]
}
});
/*
/*
// Specify icon url
var greenIcon = new LeafIcon({
iconUrl: 'https://img.icons8.com/offices/30/000000/leaf.png'
})
function addPoints(data, tabletop) {
for (var row in data) {
var marker = L.marker([
data[row].lat,
data[row].long
], {icon:greenIcon}).addTo(mymap);
// Now we're adding popups - plain version, bolded and colored
marker.bindPopup("<p>" + data[row].market_name + "<br/>" + data[row].operation + "<br/>" + data[row].weekday + "</p>");
}
}
*/
/*
//color markers based on some additional value
//specify colors
var colors = {
orange: '#ffa500',
blue: '#0000ff',
green: '#008000',
pink: '#ffc0cb',
};
//set marker opacity
var markerOptions = {
opacity: 1,
};
switch(Data[i].value) {
case "A":
markerOptions.color = colors.orange;
break;
case "B":
markerOptions.color = colors.blue;
break;
case "C":
markerOptions.color = colors.green;
break;
default:
markerOptions.color = colors.pink;
break;
}
var marker = new L.circleMarker(markerLocation,markerOptions).addTo(map);
*/
// Style for kml layer
var whoopingLayer = L.geoJson(null, {
// http://leafletjs.com/reference.html#geojson-style
style: function(feature) {
return { color: '#bcbddc', weight: .5, opacity: 1.5 };
// #aaa is just white. Use Colorbrewer2.com to find a color that you like.
}
});
// Style for kml layer
var beetleLayer = L.geoJson(null, {
// http://leafletjs.com/reference.html#geojson-style
style: function(feature) {
return { color: '#fdae6b', weight: 1, opacity: 1 };
// #aaa is just white. Use Colorbrewer2.com to find a color that you like.
}
});
// Style for kml layer
var squirrelLayer = L.geoJson(null, {
// http://leafletjs.com/reference.html#geojson-style
style: function(feature) {
return { color: '#43a2ca', weight: 1, opacity: 1.5 };
// #aaa is just white. Use Colorbrewer2.com to find a color that you like.
}
});
/*
// Import kml with omnivore
omnivore.kml("https://mrdata.usgs.gov/geology/state/kml/mtgeol.kml", null, customLayer).addTo(mymap);
*/
//Map whooping crane habitat
omnivore.kml("https://opendata.arcgis.com/datasets/74997701f62f468d9a097e9062fb9dea_68.kml?where=CommonName%20%3D%20%27Whooping%20Crane%27&geometry=%7B%22xmin%22%3A-116.376%2C%22ymin%22%3A38.584%2C%22xmax%22%3A-83%2C%22ymax%22%3A44.341%2C%22type%22%3A%22extent%22%2C%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%7D&outSR=%7B%22latestVcsWkid%22%3A5703%2C%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%2C%22vcsWkid%22%3A5703%7D", null, whoopingLayer).addTo(mymap)
//Map beetle habitat
omnivore.kml("https://opendata.arcgis.com/datasets/74997701f62f468d9a097e9062fb9dea_68.kml?where=CommonName%20%3D%20%27Salt%20Creek%20Tiger%20Beetle%27&geometry=%7B%22xmin%22%3A-116.376%2C%22ymin%22%3A38.584%2C%22xmax%22%3A-83%2C%22ymax%22%3A44.341%2C%22type%22%3A%22extent%22%2C%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%7D&outSR=%7B%22latestVcsWkid%22%3A5703%2C%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%2C%22vcsWkid%22%3A5703%7D", null, beetleLayer).addTo(mymap)
//Map Flying Squirrel habitat
omnivore.kml("https://opendata.arcgis.com/datasets/74997701f62f468d9a097e9062fb9dea_68.kml?where=CommonName%20%3D%20%27Southern%20Flying%20Squirrel%27&geometry=%7B%22xmin%22%3A-116.376%2C%22ymin%22%3A38.584%2C%22xmax%22%3A-83%2C%22ymax%22%3A44.341%2C%22type%22%3A%22extent%22%2C%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%7D&outSR=%7B%22latestVcsWkid%22%3A5703%2C%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%2C%22vcsWkid%22%3A5703%7D", null, squirrelLayer).addTo(mymap)
}
// Import kml with omnivore practice