# Plot almost anything using the GBIF maps api - GBIF Data Blog

**URL:** <https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398>\
**Category:** Data blog\
**Created:** [November 8, 2018, 10:15am UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398 "2018-11-08T10:15:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwaller](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jwaller](https://discourse.gbif.org/u/jwaller)\
**Post date:** [November 8, 2018, 10:15am UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398/1 "2018-11-08T10:15:13Z")

</div>

The [GBIF maps api](https://www.gbif.org/developer/maps) is an under-used but powerful web service provided by GBIF. The [maps api](https://www.gbif.org/developer/maps) is used by the main GBIF portal to create the maps including the [big map](https://www.gbif.org/) used on gbif.org. We can make a simple call to the api by **pasting the link** below into a **web browser**.

* * *
This is a companion discussion topic for the original entry at [https://data-blog.gbif.org/post/gbif-maps-api-using-r-and-leaflet/](https://data-blog.gbif.org/post/gbif-maps-api-using-r-and-leaflet/)

---

<div class="post-metadata">

**Author:** ![mgrosjean](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mgrosjean](https://discourse.gbif.org/u/mgrosjean)\
**Post date:** [November 12, 2018, 2:58pm UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398/2 "2018-11-12T14:58:48Z")

</div>

How can user cite the GBIF maps? Can they get a DOI?

---

<div class="post-metadata">

**Author:** ![jwaller](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jwaller](https://discourse.gbif.org/u/jwaller)\
**Post date:** [November 13, 2018, 8:13am UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398/3 "2018-11-13T08:13:34Z")

</div>

I am not sure if a user can get a doi for a map.

---

<div class="post-metadata">

**Author:** ![dnoesgaard](https://sea1.discourse-cdn.com/gbif1/user_avatar/discourse.gbif.org/dnoesgaard/32/8_2.png) [@dnoesgaard](https://discourse.gbif.org/u/dnoesgaard)\
**Post date:** [November 13, 2018, 10:44am UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398/4 "2018-11-13T10:44:58Z")

</div>

The can get a DOI for the underlying occurrences by downloading them. I wish there was a better/easier way.

---

<div class="post-metadata">

**Author:** ![danmcglinn](https://sea1.discourse-cdn.com/gbif1/user_avatar/discourse.gbif.org/danmcglinn/32/125_2.png) [@danmcglinn](https://discourse.gbif.org/u/danmcglinn)\
**Post date:** [November 29, 2018, 6:37pm UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398/5 "2018-11-29T18:37:01Z")

</div>

This is very cool, thank you for highlighting it! I did have to change the urls to http:// to get the maps to work on my system as a heads up for other folks.

I am also curious if there are legends for the density color bands and also if the raw density data is easily available without having to download the raw data and process it. Thanks!

Dan

---

<div class="post-metadata">

**Author:** ![jwaller](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jwaller](https://discourse.gbif.org/u/jwaller)\
**Post date:** [November 30, 2018, 9:09am UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398/6 "2018-11-30T09:09:56Z")

</div>

@danmcglinn I don’t think there is a legend that the GBIF maps api can give you. You are right that you probably have to get some records and pre-build the legend.

---

<div class="post-metadata">

**Author:** ![aleruete](https://sea1.discourse-cdn.com/gbif1/user_avatar/discourse.gbif.org/aleruete/32/190_2.png) [@aleruete](https://discourse.gbif.org/u/aleruete)\
**Post date:** [April 2, 2019, 6:49am UTC](https://discourse.gbif.org/t/plot-almost-anything-using-the-gbif-maps-api-gbif-data-blog/398/7 "2019-04-02T06:49:48Z")

</div>

One way of making a legend might be:  
GBIFWtGbins\<-c("#EDF8E9", “#BAE4B3”, “#74C476”, “#31A354”, “#006D2C”)

### You can get the colors using a colorpicker [https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp?hl=en-US](https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp?hl=en-US)

GBIFWtG\<-leaflet::colorBin(GBIFWtGbins, domain=c(1,1e+6), bins=c(1,10,100,1000,10000,1e+6), na.color = “transparent”)

## I got the bins by manually checking them

GBIFtiles\<-c(1,11,101,1001,10001);  
GBIFtilesLab\<-c(“1-10”,“11-100”,“101-1000”,“1001-10000”,“10001+”)

leaflet() %\>%  
addLegend(position = “bottomleft”,  
colors = GBIFWtG(GBIFtiles),  
labels = GBIFtilesLab,  
title = “No. Observations   
 Data from GBIF.org”,  
opacity = 1)

cheers
