TransforMap / transformap.github.io

http://transformap.co/
GNU General Public License v2.0
4 stars 2 forks source link

Image urls in sample data #27

Closed keikreutler closed 8 years ago

keikreutler commented 8 years ago

The sample data provides an image link like: https://base.transformap.co/wiki/File:Bees_coop_logo.png

This points to the wiki rather than the url of the image file. If the geojson already contains accreditation information, can the image urls be ammended to point to the actual file?

species commented 8 years ago

One of the reasons for using a Mediawiki as image repository is its capability to output scaled versions of a requested image. When querying the following url, you get the link to a scaled version of the images for displaying in the popup:

https://base.transformap.co/api.php?action=query&format=json&titles=File:Bees_coop_logo.png&prop=imageinfo&iiprop=url&iiurlwidth=276

You can set an arbitrary width with the &iiurlwidth= - parameter.

I've some sample code here in the demo maps map.js:1406, which is using the same functionality for Wikimedia Commons.

josefkreitmayer commented 8 years ago

https://github.com/TransforMap/transformap-viewer