Google Static Maps Problem
William Prothero
waprothero at gmail.com
Fri Jun 30 21:12:07 EDT 2017
Jonathon and hh:
Ok, it looks like I’ve made some progress, Googling around in the static maps api. I found that it is possible to directly set the lat lon bounds of the map I get. That’s even better than letting Google decide how much of the map to display and working backwards to get the corners. If I use the path= parameter and don’t specify zoom and center, I get exactly the map with the specified lat/lon bounds. Whoopee!
I’m testing it more.
However, if I do:
put "https://maps.googleapis.com/maps/api/staticmap?path=color:0x0000ff80|weight:1|34.0,-122.0|34.0,-120.0|32.0,-120.0|32.0,-122.0|34.0,-122.0&size=400x400&maptype=satellite&key=myAPIKey <https://maps.googleapis.com/maps/api/staticmap?path=color:0x0000ff80%7Cweight:1%7C34.0,-122.0%7C34.0,-120.0%7C32.0,-120.0%7C32.0,-122.0%7C34.0,-122.0&size=400x400&maptype=satellite&key=myAPIKey>" into retURL, I get a map with 34,122 (NW corner) and 32,120 (SE corner).
This is much more direct and I will use this, assuming my further tests look good.
Best,
Bill
> On Jun 30, 2017, at 6:02 PM, Jonathan Lynch via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Hi Bill,
>
> I am looking at your stack now. I don't see any place where you use JavaScript to get get the bounds from the Google maps API.
>
> I think you would have to do it that way to get a reliable result.
>
> That won't give you corners, exactly, but it will give you a minimum bounding rectangle that contains your map.
>
> Sent from my iPhone
>
>> On Jun 30, 2017, at 8:02 PM, jonathandlynch at gmail.com wrote:
>>
>> Bill,
>>
>> The bounds will only give you the corners of the image if you are facing exactly North, south, east, or west,
>>
>> I am sorry I have not had a chance to check out your stack - will do so shortly
>>
>> Sent from my iPhone
>>
>>> On Jun 30, 2017, at 7:56 PM, William Prothero via use-livecode <use-livecode at lists.runrev.com> wrote:
>>>
>>> Hermann:
>>> I got your stack. It pretty much is where I am at now. However, it doesn’t solve my problem. If you notice the “geocode” call output, nothing changes when the zoom level changes. This isn’t much help when trying to find the lat/lon values of the corners of the image. That’s what I need. Neither the “bounds” parameters nor the “viewport” parameters change with zoom level. So, it doesn’t help when trying to get the corner lat/lons, which change with zoom level.
>>>
>>> Best,
>>> Bill
>>>
>>>> On Jun 30, 2017, at 8:32 AM, hh via use-livecode <use-livecode at lists.runrev.com> wrote:
>>>>
>>>> You may use the technique of a stack I made in April 2017 on base of
>>>> a discussion started by you in the list:
>>>> http://lists.runrev.com/pipermail/use-livecode/2017-April/236632.html
>>>>
>>>> I posted it just now here (Raspi stacks collection #100)
>>>> http://forums.livecode.com/viewtopic.php?p=155414#p155414
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list