[API-users] How to simple distribution maps

Mauro Cavalcanti maurobio at gmail.com
Sat Jul 29 13:16:22 UTC 2023


Hi, Matt!

The html code below works in a browser:

<img style="background-image: url(
https://tile.gbif.org/3857/omt/0/0/0@1x.png?style=gbif-classic); src="
https://api.gbif.org/v2/map/occurrence/density/0/0/0@1x.png?style=classic.point&taxonKey=2974832
"/>

I am using it as the basis for my "poor man's" solution for displaying
distribution maps as static images outside a browser (ie., on a tailored
desktop application). The trick is to grab both images and combine them
into one!

Thanks!

With warmest regards,

Em sáb., 29 de jul. de 2023 às 05:12, Matthew Blissett via API-users <
api-users at lists.gbif.org> escreveu:

> Dear Mauro,
>
> I'm afraid this isn't possible in a single API call.  You need two calls,
> one for the land/sea basemap, and another for the occurrences:
>
> https://tile.gbif.org/3875/omt/0/0/0@1x.png?style=gbif-classic
>
>
> https://api.gbif.org/v2/map/occurrence/density/0/0/0@1x.png?taxonKey=2974832
>
> This can be done in static HTML but it requires an inline CSS property:
>
> <img style="background-image: url(https://tile.gbif.org/3875/omt/0/0/0@1x.png?style=gbif-classic);"  src="https://api.gbif.org/v2/map/occurrence/density/0/0/0@1x.png?taxonKey=2974832" >
>
> I hope that helps,
>
> Matt
> On 28/07/2023 22:07, Mauro Cavalcanti via API-users wrote:
>
> Dear ALL,
>
> I have already spent some hours now attempting to generate simple
> distribution maps using the GBIF maps API (
> https://www.gbif.org/developer/maps).
>
> I have seen the base map examples (https://tile.gbif.org/ui/) and the
> raster style demos (https://api.gbif.org/v2/map/demo.html), but could not
> understand how I could get just a simple distribution map, overlaid on a
> base map in Mercator projection and 'classic' GBIF style, as a PNG (or
> JPEG) image, *with a single API call* (that is, without css, javascript,
> etc.). Is this possible?
>
> Thanks in advance!
>
> With warmest regards,
>
> --
> Dr. Mauro J. Cavalcanti
> E-mail: maurobio at gmail.com
> Web: https://github.com/maurobio
> "Life is complex. It consists of real and imaginary parts."
>
> _______________________________________________
> API-users mailing listAPI-users at lists.gbif.orghttps://lists.gbif.org/mailman/listinfo/api-users
>
> _______________________________________________
> API-users mailing list
> API-users at lists.gbif.org
> https://lists.gbif.org/mailman/listinfo/api-users
>


-- 
Dr. Mauro J. Cavalcanti
E-mail: maurobio at gmail.com
Web: https://github.com/maurobio
"Life is complex. It consists of real and imaginary parts."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gbif.org/pipermail/api-users/attachments/20230729/17d5a656/attachment.html>


More information about the API-users mailing list