Re: Getting a Google MAP

2017-04-28 Thread William Prothero via use-livecode
Mike:
Thanks for your help.
I found a link to Python, PHP, and Pascal code to do this. Looks like I have to 
stop being lazy and do some math. I’m ok with converting the code to xTalk. I 
should be able to figure it out myself. I’ll share when I get something done. 
It may be a bit because I’ve got some other tasks pulling at me.

http://stackoverflow.com/questions/12507274/how-to-get-bounds-of-a-google-static-map
 


Best wishes and thanks again for helping me in this search,
Bill P

> On Apr 28, 2017, at 5:23 PM, Mike Bonner via use-livecode 
>  wrote:
> 
> I'll poke around more. Maybe I'll get lucky (boatloads of no in that
> phrase) and find a solution.
> 
> On Fri, Apr 28, 2017 at 5:55 PM, William Prothero via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Ok, its a bit more complicated. After my initial high at thinking the
>> problem was solved (rushing to a haircut appointment before looking
>> carefully), I noticed that the returned data from Mike’s reverse geocoding
>> URL didn’t change with the zoom level. So apparently, it’s only applied to
>> the stated location. The reverse geo lookup finds a city or address and the
>> “bounds” elements don’t give the lat/lon values at the corner of the image.
>> 
>> I’m fiddling with this, and I’ve got the link (somewhat incomplete
>> derivation) of how to calculate the corner lat/lons, so I’ll try that next.
>> I wish there was a google call I could make that would give me this info,
>> but I can’t find it.
>> 
>> Best,
>> Bill
>> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting a Google MAP

2017-04-28 Thread Mike Bonner via use-livecode
I'll poke around more. Maybe I'll get lucky (boatloads of no in that
phrase) and find a solution.

On Fri, Apr 28, 2017 at 5:55 PM, William Prothero via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Ok, its a bit more complicated. After my initial high at thinking the
> problem was solved (rushing to a haircut appointment before looking
> carefully), I noticed that the returned data from Mike’s reverse geocoding
> URL didn’t change with the zoom level. So apparently, it’s only applied to
> the stated location. The reverse geo lookup finds a city or address and the
> “bounds” elements don’t give the lat/lon values at the corner of the image.
>
> I’m fiddling with this, and I’ve got the link (somewhat incomplete
> derivation) of how to calculate the corner lat/lons, so I’ll try that next.
> I wish there was a google call I could make that would give me this info,
> but I can’t find it.
>
> Best,
> Bill
>
> > On Apr 28, 2017, at 1:49 PM, William Prothero via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I’m willing. Hermann has been generous with good ideas too.
> > Best,
> > Bill
> >
> >> On Apr 28, 2017, at 1:45 PM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> If you ever get down to the middle of nowhere new mexico, I'll take you
> up
> >> on the lunch offer.  :) Think others mentioned the same api though, so
> >> there might be lunches all around.
> >>
> >>
> >> On Fri, Apr 28, 2017 at 2:41 PM, William Prothero via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >>
> >>> Mike:
> >>> OMG, I LOVE YOU! Fantastic, this is just what I need. I hope I meet you
> >>> some day so I can buy you dinner. Let me know if you get by Santa
> Barbara,
> >>> or Portland area.
> >>>
> >>> Best,
> >>> Bill
> >>>
> >>>
>  On Apr 28, 2017, at 10:56 AM, Mike Bonner via use-livecode <
> >>> use-livecode@lists.runrev.com> wrote:
> 
>  If you do a second call to the geocode api you can get the info you
> need.
> 
>  https://maps.googleapis.com/maps/api/geocode/json?address=
> >>> Berkeley,+CA=14=400x400
> 
>  There appear to be 2 location sections.  One contains the bounds of
> the
>  request, the other contains the bounds of the viewport IE zoom level
> 14,
> >>> at
>  400x400
> 
>  i haven't really tested much other than to see what kind of results
> come
>  back, but hopefully this will get you to where you want to go.
> 
>  I also saw the following..
>  https://gis.stackexchange.com/questions/46729/corner-
> >>> coordinates-of-google-static-map-tile
>  which is very interesting. The problem being you would still need the
>  center point as a starting position, then you can calculate the
> corners
>  based on the zoom factor.
> 
>  On Fri, Apr 28, 2017 at 9:42 AM, prothero--- via use-livecode <
>  use-livecode@lists.runrev.com> wrote:
> 
> > Thanks for the openstreetmap link. I'm really liking the Google maps
> > option since my app is being developed for free distribution to
> >>> educators
> > and I am not particularly interested in streets. The satellite or
> >>> terrain
> > views are what I want.
> >
> > Now all I have to do is figure out how to get the lat/Lon values at
> the
> > corners. Then I'll be all set.
> >
> > If anybody else is interested in what .I'm doing, I'll be glad to
> share
> > code.
> >
> > Best,
> > Bill
> >
> > Best,Mike:
> > Bill
> >
> > William Prothero
> > http://es.earthednet.org
> >
> >> On Apr 28, 2017, at 2:22 AM, hh via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >>
> >> Not to forget related to (static) maps, especially as you can have
> >> them from there also as SVG or 'true' PDF (not embedded PNG only):
> >>
> >> https://www.openstreetmap.org
> >>
> >> For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
> >> see https://wiki.openstreetmap.org/wiki/Export
> >>
> >> In short:
> >> Don't use the Export button at top/left (which is for raw map
> >> data) but _the sharing link at right_ that opens a prefs box.
> >>
> >>
> >> ___
> >> use-livecode mailing list
> >> use-livecode@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@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@lists.runrev.com
>  Please 

Re: Getting a Google MAP

2017-04-28 Thread William Prothero via use-livecode
Ok, its a bit more complicated. After my initial high at thinking the problem 
was solved (rushing to a haircut appointment before looking carefully), I 
noticed that the returned data from Mike’s reverse geocoding URL didn’t change 
with the zoom level. So apparently, it’s only applied to the stated location. 
The reverse geo lookup finds a city or address and the “bounds” elements don’t 
give the lat/lon values at the corner of the image.

I’m fiddling with this, and I’ve got the link (somewhat incomplete derivation) 
of how to calculate the corner lat/lons, so I’ll try that next. I wish there 
was a google call I could make that would give me this info, but I can’t find 
it.

Best,
Bill

> On Apr 28, 2017, at 1:49 PM, William Prothero via use-livecode 
>  wrote:
> 
> I’m willing. Hermann has been generous with good ideas too.
> Best,
> Bill
> 
>> On Apr 28, 2017, at 1:45 PM, Mike Bonner via use-livecode 
>>  wrote:
>> 
>> If you ever get down to the middle of nowhere new mexico, I'll take you up
>> on the lunch offer.  :) Think others mentioned the same api though, so
>> there might be lunches all around.
>> 
>> 
>> On Fri, Apr 28, 2017 at 2:41 PM, William Prothero via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>>> Mike:
>>> OMG, I LOVE YOU! Fantastic, this is just what I need. I hope I meet you
>>> some day so I can buy you dinner. Let me know if you get by Santa Barbara,
>>> or Portland area.
>>> 
>>> Best,
>>> Bill
>>> 
>>> 
 On Apr 28, 2017, at 10:56 AM, Mike Bonner via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
 
 If you do a second call to the geocode api you can get the info you need.
 
 https://maps.googleapis.com/maps/api/geocode/json?address=
>>> Berkeley,+CA=14=400x400
 
 There appear to be 2 location sections.  One contains the bounds of the
 request, the other contains the bounds of the viewport IE zoom level 14,
>>> at
 400x400
 
 i haven't really tested much other than to see what kind of results come
 back, but hopefully this will get you to where you want to go.
 
 I also saw the following..
 https://gis.stackexchange.com/questions/46729/corner-
>>> coordinates-of-google-static-map-tile
 which is very interesting. The problem being you would still need the
 center point as a starting position, then you can calculate the corners
 based on the zoom factor.
 
 On Fri, Apr 28, 2017 at 9:42 AM, prothero--- via use-livecode <
 use-livecode@lists.runrev.com> wrote:
 
> Thanks for the openstreetmap link. I'm really liking the Google maps
> option since my app is being developed for free distribution to
>>> educators
> and I am not particularly interested in streets. The satellite or
>>> terrain
> views are what I want.
> 
> Now all I have to do is figure out how to get the lat/Lon values at the
> corners. Then I'll be all set.
> 
> If anybody else is interested in what .I'm doing, I'll be glad to share
> code.
> 
> Best,
> Bill
> 
> Best,Mike:
> Bill
> 
> William Prothero
> http://es.earthednet.org
> 
>> On Apr 28, 2017, at 2:22 AM, hh via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>> 
>> Not to forget related to (static) maps, especially as you can have
>> them from there also as SVG or 'true' PDF (not embedded PNG only):
>> 
>> https://www.openstreetmap.org
>> 
>> For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
>> see https://wiki.openstreetmap.org/wiki/Export
>> 
>> In short:
>> Don't use the Export button at top/left (which is for raw map
>> data) but _the sharing link at right_ that opens a prefs box.
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@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@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@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@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting a Google MAP

2017-04-28 Thread William Prothero via use-livecode
I’m willing. Hermann has been generous with good ideas too.
Best,
Bill

> On Apr 28, 2017, at 1:45 PM, Mike Bonner via use-livecode 
>  wrote:
> 
> If you ever get down to the middle of nowhere new mexico, I'll take you up
> on the lunch offer.  :) Think others mentioned the same api though, so
> there might be lunches all around.
> 
> 
> On Fri, Apr 28, 2017 at 2:41 PM, William Prothero via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Mike:
>> OMG, I LOVE YOU! Fantastic, this is just what I need. I hope I meet you
>> some day so I can buy you dinner. Let me know if you get by Santa Barbara,
>> or Portland area.
>> 
>> Best,
>> Bill
>> 
>> 
>>> On Apr 28, 2017, at 10:56 AM, Mike Bonner via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> If you do a second call to the geocode api you can get the info you need.
>>> 
>>> https://maps.googleapis.com/maps/api/geocode/json?address=
>> Berkeley,+CA=14=400x400
>>> 
>>> There appear to be 2 location sections.  One contains the bounds of the
>>> request, the other contains the bounds of the viewport IE zoom level 14,
>> at
>>> 400x400
>>> 
>>> i haven't really tested much other than to see what kind of results come
>>> back, but hopefully this will get you to where you want to go.
>>> 
>>> I also saw the following..
>>> https://gis.stackexchange.com/questions/46729/corner-
>> coordinates-of-google-static-map-tile
>>> which is very interesting. The problem being you would still need the
>>> center point as a starting position, then you can calculate the corners
>>> based on the zoom factor.
>>> 
>>> On Fri, Apr 28, 2017 at 9:42 AM, prothero--- via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>> 
 Thanks for the openstreetmap link. I'm really liking the Google maps
 option since my app is being developed for free distribution to
>> educators
 and I am not particularly interested in streets. The satellite or
>> terrain
 views are what I want.
 
 Now all I have to do is figure out how to get the lat/Lon values at the
 corners. Then I'll be all set.
 
 If anybody else is interested in what .I'm doing, I'll be glad to share
 code.
 
 Best,
 Bill
 
 Best,Mike:
 Bill
 
 William Prothero
 http://es.earthednet.org
 
> On Apr 28, 2017, at 2:22 AM, hh via use-livecode <
 use-livecode@lists.runrev.com> wrote:
> 
> Not to forget related to (static) maps, especially as you can have
> them from there also as SVG or 'true' PDF (not embedded PNG only):
> 
> https://www.openstreetmap.org
> 
> For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
> see https://wiki.openstreetmap.org/wiki/Export
> 
> In short:
> Don't use the Export button at top/left (which is for raw map
> data) but _the sharing link at right_ that opens a prefs box.
> 
> 
> ___
> use-livecode mailing list
> use-livecode@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@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@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting a Google MAP

2017-04-28 Thread William Prothero via use-livecode
Hermann:
Thanks so much. This is very helpful. I thought I was in for a huge tussle 
getting this to work and now I see that it’s not going to be a huge hassle. I 
write geophysical data on a map and Google puts out some nice looking terrain 
maps, and now I don’t need to include maps in my app. Wonderful!

Best,
Bill

> On Apr 28, 2017, at 11:17 AM, hh via use-livecode 
>  wrote:
> 
> Have you already seen this nifty utility?
> http://staticmapmaker.com/google/
> 
> ===
> 
> I use the following for getting the geo-location.
> 
> on mouseUp
>  put url ("https://maps.googleapis.com/maps/api/geocode/; & \
>  "json?address=25a+Thistle+Street+SW,+Edinburgh,+UK") into rslt
>  replace quote with empty in rslt
>  replace space with empty in rslt
>  put offset ("location:{",rslt) into offs
>  put line 2 to 3 of (char offs to -1 of rslt) into fld 1
> end mouseUp
> 
> For displaying, I usually align the (right-aligned) fld 1 
> to the botRight of the image/ map display.
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting a Google MAP

2017-04-28 Thread Mike Bonner via use-livecode
If you ever get down to the middle of nowhere new mexico, I'll take you up
on the lunch offer.  :) Think others mentioned the same api though, so
there might be lunches all around.


On Fri, Apr 28, 2017 at 2:41 PM, William Prothero via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Mike:
> OMG, I LOVE YOU! Fantastic, this is just what I need. I hope I meet you
> some day so I can buy you dinner. Let me know if you get by Santa Barbara,
> or Portland area.
>
> Best,
> Bill
>
>
> > On Apr 28, 2017, at 10:56 AM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > If you do a second call to the geocode api you can get the info you need.
> >
> > https://maps.googleapis.com/maps/api/geocode/json?address=
> Berkeley,+CA=14=400x400
> >
> > There appear to be 2 location sections.  One contains the bounds of the
> > request, the other contains the bounds of the viewport IE zoom level 14,
> at
> > 400x400
> >
> > i haven't really tested much other than to see what kind of results come
> > back, but hopefully this will get you to where you want to go.
> >
> > I also saw the following..
> > https://gis.stackexchange.com/questions/46729/corner-
> coordinates-of-google-static-map-tile
> > which is very interesting. The problem being you would still need the
> > center point as a starting position, then you can calculate the corners
> > based on the zoom factor.
> >
> > On Fri, Apr 28, 2017 at 9:42 AM, prothero--- via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> Thanks for the openstreetmap link. I'm really liking the Google maps
> >> option since my app is being developed for free distribution to
> educators
> >> and I am not particularly interested in streets. The satellite or
> terrain
> >> views are what I want.
> >>
> >> Now all I have to do is figure out how to get the lat/Lon values at the
> >> corners. Then I'll be all set.
> >>
> >> If anybody else is interested in what .I'm doing, I'll be glad to share
> >> code.
> >>
> >> Best,
> >> Bill
> >>
> >> Best,Mike:
> >> Bill
> >>
> >> William Prothero
> >> http://es.earthednet.org
> >>
> >>> On Apr 28, 2017, at 2:22 AM, hh via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >>>
> >>> Not to forget related to (static) maps, especially as you can have
> >>> them from there also as SVG or 'true' PDF (not embedded PNG only):
> >>>
> >>> https://www.openstreetmap.org
> >>>
> >>> For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
> >>> see https://wiki.openstreetmap.org/wiki/Export
> >>>
> >>> In short:
> >>> Don't use the Export button at top/left (which is for raw map
> >>> data) but _the sharing link at right_ that opens a prefs box.
> >>>
> >>>
> >>> ___
> >>> use-livecode mailing list
> >>> use-livecode@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@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-28 Thread William Prothero via use-livecode
Mike:
OMG, I LOVE YOU! Fantastic, this is just what I need. I hope I meet you some 
day so I can buy you dinner. Let me know if you get by Santa Barbara, or 
Portland area.

Best,
Bill


> On Apr 28, 2017, at 10:56 AM, Mike Bonner via use-livecode 
>  wrote:
> 
> If you do a second call to the geocode api you can get the info you need.
> 
> https://maps.googleapis.com/maps/api/geocode/json?address=Berkeley,+CA=14=400x400
> 
> There appear to be 2 location sections.  One contains the bounds of the
> request, the other contains the bounds of the viewport IE zoom level 14, at
> 400x400
> 
> i haven't really tested much other than to see what kind of results come
> back, but hopefully this will get you to where you want to go.
> 
> I also saw the following..
> https://gis.stackexchange.com/questions/46729/corner-coordinates-of-google-static-map-tile
> which is very interesting. The problem being you would still need the
> center point as a starting position, then you can calculate the corners
> based on the zoom factor.
> 
> On Fri, Apr 28, 2017 at 9:42 AM, prothero--- via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Thanks for the openstreetmap link. I'm really liking the Google maps
>> option since my app is being developed for free distribution to educators
>> and I am not particularly interested in streets. The satellite or terrain
>> views are what I want.
>> 
>> Now all I have to do is figure out how to get the lat/Lon values at the
>> corners. Then I'll be all set.
>> 
>> If anybody else is interested in what .I'm doing, I'll be glad to share
>> code.
>> 
>> Best,
>> Bill
>> 
>> Best,Mike:
>> Bill
>> 
>> William Prothero
>> http://es.earthednet.org
>> 
>>> On Apr 28, 2017, at 2:22 AM, hh via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> Not to forget related to (static) maps, especially as you can have
>>> them from there also as SVG or 'true' PDF (not embedded PNG only):
>>> 
>>> https://www.openstreetmap.org
>>> 
>>> For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
>>> see https://wiki.openstreetmap.org/wiki/Export
>>> 
>>> In short:
>>> Don't use the Export button at top/left (which is for raw map
>>> data) but _the sharing link at right_ that opens a prefs box.
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-28 Thread hh via use-livecode
Have you already seen this nifty utility?
http://staticmapmaker.com/google/

===

I use the following for getting the geo-location.

on mouseUp
  put url ("https://maps.googleapis.com/maps/api/geocode/; & \
  "json?address=25a+Thistle+Street+SW,+Edinburgh,+UK") into rslt
  replace quote with empty in rslt
  replace space with empty in rslt
  put offset ("location:{",rslt) into offs
  put line 2 to 3 of (char offs to -1 of rslt) into fld 1
end mouseUp

For displaying, I usually align the (right-aligned) fld 1 
to the botRight of the image/ map display.



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-28 Thread Mike Bonner via use-livecode
heres a link to the geocode api information:
https://developers.google.com/maps/documentation/geocoding/intro  I'm not
sure my interpretation of the viewport is accurate, but even if you just
use the center point and do the calculations, and ignore the rest of the
data, it should work.

On Fri, Apr 28, 2017 at 11:56 AM, Mike Bonner  wrote:

> If you do a second call to the geocode api you can get the info you need.
>
> https://maps.googleapis.com/maps/api/geocode/json?address=
> Berkeley,+CA=14=400x400
>
> There appear to be 2 location sections.  One contains the bounds of the
> request, the other contains the bounds of the viewport IE zoom level 14, at
> 400x400
>
> i haven't really tested much other than to see what kind of results come
> back, but hopefully this will get you to where you want to go.
>
> I also saw the following.. https://gis.stackexchange.com/questions/
> 46729/corner-coordinates-of-google-static-map-tile which is very
> interesting. The problem being you would still need the center point as a
> starting position, then you can calculate the corners based on the zoom
> factor.
>
> On Fri, Apr 28, 2017 at 9:42 AM, prothero--- via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Thanks for the openstreetmap link. I'm really liking the Google maps
>> option since my app is being developed for free distribution to educators
>> and I am not particularly interested in streets. The satellite or terrain
>> views are what I want.
>>
>> Now all I have to do is figure out how to get the lat/Lon values at the
>> corners. Then I'll be all set.
>>
>> If anybody else is interested in what .I'm doing, I'll be glad to share
>> code.
>>
>> Best,
>> Bill
>>
>> Best,
>> Bill
>>
>> William Prothero
>> http://es.earthednet.org
>>
>> > On Apr 28, 2017, at 2:22 AM, hh via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> > Not to forget related to (static) maps, especially as you can have
>> > them from there also as SVG or 'true' PDF (not embedded PNG only):
>> >
>> > https://www.openstreetmap.org
>> >
>> > For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
>> > see https://wiki.openstreetmap.org/wiki/Export
>> >
>> > In short:
>> > Don't use the Export button at top/left (which is for raw map
>> > data) but _the sharing link at right_ that opens a prefs box.
>> >
>> >
>> > ___
>> > use-livecode mailing list
>> > use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-28 Thread Mike Bonner via use-livecode
If you do a second call to the geocode api you can get the info you need.

https://maps.googleapis.com/maps/api/geocode/json?address=Berkeley,+CA=14=400x400

There appear to be 2 location sections.  One contains the bounds of the
request, the other contains the bounds of the viewport IE zoom level 14, at
400x400

i haven't really tested much other than to see what kind of results come
back, but hopefully this will get you to where you want to go.

I also saw the following..
https://gis.stackexchange.com/questions/46729/corner-coordinates-of-google-static-map-tile
which is very interesting. The problem being you would still need the
center point as a starting position, then you can calculate the corners
based on the zoom factor.

On Fri, Apr 28, 2017 at 9:42 AM, prothero--- via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks for the openstreetmap link. I'm really liking the Google maps
> option since my app is being developed for free distribution to educators
> and I am not particularly interested in streets. The satellite or terrain
> views are what I want.
>
> Now all I have to do is figure out how to get the lat/Lon values at the
> corners. Then I'll be all set.
>
> If anybody else is interested in what .I'm doing, I'll be glad to share
> code.
>
> Best,
> Bill
>
> Best,
> Bill
>
> William Prothero
> http://es.earthednet.org
>
> > On Apr 28, 2017, at 2:22 AM, hh via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Not to forget related to (static) maps, especially as you can have
> > them from there also as SVG or 'true' PDF (not embedded PNG only):
> >
> > https://www.openstreetmap.org
> >
> > For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
> > see https://wiki.openstreetmap.org/wiki/Export
> >
> > In short:
> > Don't use the Export button at top/left (which is for raw map
> > data) but _the sharing link at right_ that opens a prefs box.
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



Re: Getting a Google MAP

2017-04-28 Thread prothero--- via use-livecode
Thanks for the openstreetmap link. I'm really liking the Google maps option 
since my app is being developed for free distribution to educators and I am not 
particularly interested in streets. The satellite or terrain views are what I 
want.

Now all I have to do is figure out how to get the lat/Lon values at the 
corners. Then I'll be all set.

If anybody else is interested in what .I'm doing, I'll be glad to share code.

Best,
Bill

Best,
Bill

William Prothero
http://es.earthednet.org

> On Apr 28, 2017, at 2:22 AM, hh via use-livecode 
>  wrote:
> 
> Not to forget related to (static) maps, especially as you can have
> them from there also as SVG or 'true' PDF (not embedded PNG only):
> 
> https://www.openstreetmap.org
> 
> For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
> see https://wiki.openstreetmap.org/wiki/Export
> 
> In short:
> Don't use the Export button at top/left (which is for raw map
> data) but _the sharing link at right_ that opens a prefs box.
> 
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-28 Thread hh via use-livecode
Not to forget related to (static) maps, especially as you can have
them from there also as SVG or 'true' PDF (not embedded PNG only):

https://www.openstreetmap.org

For exporting as HTML link or as an "image" (JPG, PNG, SVG, PDF)
see https://wiki.openstreetmap.org/wiki/Export

In short:
Don't use the Export button at top/left (which is for raw map
data) but _the sharing link at right_ that opens a prefs box.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-27 Thread William Prothero via use-livecode
Hmm, I must have spoken too soon. This actually works!

on mouseUp

put mapURL() into tURL

put URL tURL into x

put x into image "myGMap"

end mouseUp


function mapURL

put 
"https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA=14=400x400=AIzaSyCO423QzwaEEBmiw4XjPKzz4Tcg_5bjHv4;
 into retURL

return retURL

end mapURL



> On Apr 27, 2017, at 3:36 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> Here is how I get directions in a map:
> 
> on mouseUp pMouseBtnNo
>   put 
> "https://www.google.com/maps/dir/12150+Mora+Dr,+Santa+Fe+Springs,+CA+90670,+USA/;
>  into theURL
>   put the dgHilitedLine of group "dgSites" into theHilitedLine
>   put the dgDataOfLine [thehilitedline] of group "dgSites" into aRecordData
>   put urlencode(aRecordData["addr1"]) & "+" & \
> urlencode(aRecordData["city"]) & "+" & \
> urlencode(aRecordData["state"]) & "+" & \
> urlencode(aRecordData["zip"]) into theAddress
>   set the clipboarddata to \
> aRecordData["addr1"] & space & \
> aRecordData["city"] & space & \
> aRecordData["state"] & space & \
> aRecordData["zip"]
>   put theURL & urlencode(theAddress) into theURL
>   launch url theURL
> end mouseUp
> 
> Note I have hardcoded the start location into the URL, but that can be dealt 
> with easy enough. Also I am pullign data from a datagrid, but that also can 
> be sussed out easily enough. This *should* work in a browser object, no? 
> 
> Bob S
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-27 Thread Bob Sneidar via use-livecode
Here is how I get directions in a map:

on mouseUp pMouseBtnNo
   put 
"https://www.google.com/maps/dir/12150+Mora+Dr,+Santa+Fe+Springs,+CA+90670,+USA/;
 into theURL
   put the dgHilitedLine of group "dgSites" into theHilitedLine
   put the dgDataOfLine [thehilitedline] of group "dgSites" into aRecordData
   put urlencode(aRecordData["addr1"]) & "+" & \
 urlencode(aRecordData["city"]) & "+" & \
 urlencode(aRecordData["state"]) & "+" & \
 urlencode(aRecordData["zip"]) into theAddress
   set the clipboarddata to \
 aRecordData["addr1"] & space & \
 aRecordData["city"] & space & \
 aRecordData["state"] & space & \
 aRecordData["zip"]
   put theURL & urlencode(theAddress) into theURL
   launch url theURL
end mouseUp

Note I have hardcoded the start location into the URL, but that can be dealt 
with easy enough. Also I am pullign data from a datagrid, but that also can be 
sussed out easily enough. This *should* work in a browser object, no? 

Bob S



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting a Google MAP

2017-04-27 Thread Devin Asay via use-livecode
Bill,

As Mike mentioned, the API call returns image data, so set the filename of an 
image to the url. Here’s the script from a working demo:

on mouseUp
put urlEncode(fld "address") into tAddress
put urlEncode(fld "city") into tCity
put urlEncode(fld "state") into tState

put the thumbposition of scrollbar "scale" into tScale
put the hilitedButtonName of group "maptype" into tType
put "http://maps.google.com/maps/api/staticmap; into tBaseURL
put  "?center=" into tArgList
if tAddress is empty then
--put empty into tArgList
else
put tAddress & comma after tArgList
end if
put tCity & comma & tState after tArgList
put "=" & tScale & "=512x512=" & tType after tArgList

# build marker
put urlEncode(fld "m_address") into tMAddress
put urlEncode(fld "m_city") into tMCity
put urlEncode(fld "m_state") into tMState
put the label of btn "color" into tMColor
put toUpper(char 1 of fld "label") into tMLabel
put "=" & "color:" & tMColor & "|label:" & tMLabel & "|" & 
tMAddress,tMCity,tMState after tArgList

put tBaseURL & tArgList into fld "urlfld"
set the filename of img "map" to fld "urlfld"
end mouseUp

Most of the script is building a URL string with the proper arguments. The last 
two statements are where you actually display the image.

One thing I will say its that if you want to use it for other than just 
occasional demos, you will have to register with Google for an API key, when 
gets tacked on to the end of the argument list for the URL.

If you’d like you can grab the working stack here (from the message box):

go stack URL 
"http://dight310.byu.edu/lesson_materials/14-Web_services/googleMaps.livecode;

Hope this helps.

Devin


On Apr 27, 2017, at 2:49 PM, William Prothero via use-livecode 
> wrote:

Folks:
Turns out there is a Google Static Map api. I’m trying to use it, but get no 
response from my code that indicates an error.
The Static Maps API URL is: 
https://developers.google.com/maps/documentation/static-maps/?csw=1 


From the dictionary, it looks like I can do this: (this is the example in the 
google docs. It gives me a map when I put the URL into the browser).
on mouseUp

 put mapURL() into tURL

 put tURL

  put URL tURL into x

  put x into image  “myGMap” —This, obviously won’t work. See below.

end mouseUp


function mapURL

   put 
"https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA=14=400x400=AIzaSyCO423QzwaEEBmiw4XjPKzz4Tcg_5bjHv4;
 into retURL

return retURL

end mapURL

I get text back that looks like that below. It is obviously in some format I 
can decode in Livecode. I’ve just reached my comfort level with this. How 
should I decode this. so I can set the imagedata to it?
Tnx,
Bill P

—start of returned text
âPNG



���
IHDR��ê��ê���∑a∆˛��ùPLTE<84{<,KKKLLLNNNSPLPPPRRRTTTVVVYYY^^^aaabbbdddfffkgchhhmmmssstttxxxzzz4®S�õ⁄BÖÙDÑÚEÜÚIäÒNäÚOçÚPçÚSèÚTêÚXíZíÛYîÙaóÙbòıjùÙmûıt£Û{•}™Úó{WãocÍC5ËD8ËE:ÈG9ÈJ:ÈL?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Director
Office of Digital Humanities
Brigham Young University

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting a Google MAP

2017-04-27 Thread Mike Bonner via use-livecode
Since its a static map, its returned in image format (note the png at the
beginning)

You should be able to: put URL "
https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA=14=400x400=AIzaSyCO423QzwaEEBmiw4XjPKzz4Tcg_5bjHv4;
into img "myImage" and viola. have the map appear.

On Thu, Apr 27, 2017 at 2:49 PM, William Prothero via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Folks:
> Turns out there is a Google Static Map api. I’m trying to use it, but get
> no response from my code that indicates an error.
> The Static Maps API URL is: https://developers.google.com/
> maps/documentation/static-maps/?csw=1  com/maps/documentation/static-maps/?csw=1>
>
> From the dictionary, it looks like I can do this: (this is the example in
> the google docs. It gives me a map when I put the URL into the browser).
> on mouseUp
>
>   put mapURL() into tURL
>
>   put tURL
>
>put URL tURL into x
>
>put x into image  “myGMap” —This, obviously won’t work. See below.
>
> end mouseUp
>
>
> function mapURL
>
> put "https://maps.googleapis.com/maps/api/staticmap?center=
> Berkeley,CA=14=400x400=AIzaSyCO423QzwaEEBmiw4XjPKzz4T
> cg_5bjHv4" into retURL
>
>  return retURL
>
> end mapURL
>
> I get text back that looks like that below. It is obviously in some format
> I can decode in Livecode. I’ve just reached my comfort level with this. How
> should I decode this. so I can set the imagedata to it?
> Tnx,
> Bill P
>
> —start of returned text
> âPNG
>
>
>
> ���
> IHDR�� ê�� ê  ���∑a∆˛�� ùPLTE<84{<,KKKLLLNNNSPLPPPRRRTTTVVVYYY^^^
> aaabbbdddfffkgchhhmmmssstttxxxzzz   4®S�õ⁄BÖÙDÑÚEÜÚIäÒNäÚOçÚPçÚSèÚTêÚXí
> ZíÛYîÙaóÙbòıjùÙmûıt£Û{•}™Úó{WãocÍC5ËD8ËE:ÈG9ÈJ:ÈL?
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Getting a Google MAP

2017-04-27 Thread William Prothero via use-livecode
Folks:
Turns out there is a Google Static Map api. I’m trying to use it, but get no 
response from my code that indicates an error.
The Static Maps API URL is: 
https://developers.google.com/maps/documentation/static-maps/?csw=1 


From the dictionary, it looks like I can do this: (this is the example in the 
google docs. It gives me a map when I put the URL into the browser). 
on mouseUp

  put mapURL() into tURL

  put tURL

   put URL tURL into x

   put x into image  “myGMap” —This, obviously won’t work. See below. 

end mouseUp


function mapURL

put 
"https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA=14=400x400=AIzaSyCO423QzwaEEBmiw4XjPKzz4Tcg_5bjHv4;
 into retURL

 return retURL

end mapURL

I get text back that looks like that below. It is obviously in some format I 
can decode in Livecode. I’ve just reached my comfort level with this. How 
should I decode this. so I can set the imagedata to it?
Tnx,
Bill P

—start of returned text
âPNG 



���
IHDR��ê��ê���∑a∆˛��ùPLTE<84{<,KKKLLLNNNSPLPPPRRRTTTVVVYYY^^^aaabbbdddfffkgchhhmmmssstttxxxzzz4®S�õ⁄BÖÙDÑÚEÜÚIäÒNäÚOçÚPçÚSèÚTêÚXíZíÛYîÙaóÙbòıjùÙmûıt£Û{•}™Úó{WãocÍC5ËD8ËE:ÈG9ÈJ:ÈL?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode