hi

i have a species database (php/mysql) with more then 1000 species in it. each species has multiple localities. i want to show these localities on a map for each species. is it possible to directly pull the data from the database and plot these points.

i want to know how to link the database to map so dat when the user clicks on the species page, a map is displayed showing the distribution of the species.


** the map can be google map or any other if better option if available

Recommended Answers

All 4 Replies

Please explain more

If the species is given, the task is simple (to describe).
First SELECT latitude, longitude FROM locations WHERE SPECIES=myspecies
Then set a marker on your map at each lat/lon point. You can do that with the Google Maps API.
If you choose other maps without an API (e.g. from Wikimedia), you will have to map the geographical coordinates to pixels on the map. This is easy for small areas of the globe where you can use linear trigonometry, but becomes a little bit trickier if your maps and species distribution comprises relevant part of the globe - then you will have to use spherical trigonometry.

It is still the same as smantscheff said, only you have a lot of points per species.

Do you have code already ? Is your species page up and running, did you try to add a map already? There are some samples in this forum from last month about google maps. Perhaps start there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.