{"size": 608, "ext": "js", "max_stars_repo_path": "app/javascript/packs/gbif_occurrence_map.js", "max_stars_repo_name": "UCcongenomics/caledna", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/javascript/packs/gbif_occurrence_map.js", "max_issues_repo_name": "UCcongenomics/caledna", "max_issues_repo_issues_event_min_datetime": "2018-02-13T16:44:49.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-24T04:39:27.000Z", "max_forks_repo_path": "app/javascript/packs/gbif_occurrence_map.js", "max_forks_repo_name": "caledna/caledna", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 98, "max_forks_count": null, "avg_line_length": 26.4347826087, "max_line_length": 87, "alphanum_fraction": 0.6430921053}
const taxonId = window.caledna && window.caledna.gbif_id;

if (taxonId) {
  const map = L.map("gbif-occurrence-map", {
    center: L.latLng(0, 0),
    zoom: 1,
    minZoom: 1,
    maxZoom: 18
  });

  // gbif map tiles
  L.tileLayer(
    "https://tile.gbif.org/3857/omt/{z}/{x}/{y}@2x.png?style=gbif-geyser"
  ).addTo(map);

  // gbif occurrences
  const hexPerTile = 50;
  const apiEndpoint =
    "https://api.gbif.org/v2/map/occurrence/density/{z}/{x}/{y}@2x.png?srs=EPSG:3857" +
    `&style=purpleYellow.poly&bin=hex&hexPerTile=${hexPerTile}&taxonKey=${taxonId}`;
  L.tileLayer(apiEndpoint).addTo(map);
}
