Retrieving gif data from a RESTful map server

Devin Asay devin_asay at byu.edu
Thu Apr 11 12:57:15 EDT 2013


On Apr 11, 2013, at 10:43 AM, <MacBox at earthlink.net>
 wrote:

> I'm attempting to get a traffic gif from mapquest via their RESTful API, but I am unable to display it; everything results in the image object displaying a grey pattern.
> 
> Some of the things I have tried so far:
> 
>  set the text of img "map" to url MapQuestsLongAPIKeyedURL
> 
>  set the imageData of img "map" to url MapQuestsLongAPIKeyedURL
> 
>  put url MapQuestsLongAPIKeyedURL into img "map"
> 
>  get url MapQuestsLongAPIKeyedURL
>  put it into url (binfile:LocalFilePath)
>  set the filename of img "map" to LocalFilePath
> 
> What's interesting is that the saved file from that last attempt will display in Finder via QuickLook, and open up in Preview as well without issue. If I then re-save the file from Preview, THAT file will load into a LiveCode image object (Note: oddly, if I open and save the file from Safari it will not load properly)
> 
> I'm guessing that the problem is that I'm trying to dump both the Gif's image and mask data all into the image object, while QuickLook, Finder, Preview, and even Safari know how to reassemble them properly as image and mask data for display.
> 
> Does anyone have any ideas for getting this incoming Gif data into an image object properly? Thanks!


Try this:

Set the filename of image "map" to MapQuestsLongAPIKeyedURL

This works, for example, with the Google Static Maps API.

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University





More information about the use-livecode mailing list