Google Static Maps Demo Available

2017-07-06 Thread William Prothero via use-livecode
Folks:
Thanks to help from Hermann, I am sharing a demo stack that accesses the Google 
Static Maps API to display maps. This API allows me to display a terrain map, 
and determine the lat/lon values of any point on the map, I will take a 
snapshot of the map image and draw symbols on it that will represent 
geophysical data. 

You can download the demo at:
http://earthlearningsolutions.org/google-static-maps-demo/ 


I hope you find it useful. 
Bill P

William A. Prothero
http://earthlearningsolution.org/

___
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: Google Static Maps Demo Available

2017-07-06 Thread Jonathan Lynch via use-livecode
Thanks for this, Bill

Sent from my iPhone

> On Jul 6, 2017, at 8:31 PM, William Prothero via use-livecode 
>  wrote:
> 
> Folks:
> Thanks to help from Hermann, I am sharing a demo stack that accesses the 
> Google Static Maps API to display maps. This API allows me to display a 
> terrain map, and determine the lat/lon values of any point on the map, I will 
> take a snapshot of the map image and draw symbols on it that will represent 
> geophysical data. 
> 
> You can download the demo at:
> http://earthlearningsolutions.org/google-static-maps-demo/ 
> 
> 
> I hope you find it useful. 
> Bill P
> 
> William A. Prothero
> http://earthlearningsolution.org/
> 
> ___
> 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: Google Static Maps Demo Available

2017-07-06 Thread Mark Wieder via use-livecode

On 07/06/2017 05:31 PM, William Prothero via use-livecode wrote:

Folks:
Thanks to help from Hermann, I am sharing a demo stack that accesses the Google 
Static Maps API to display maps. This API allows me to display a terrain map, 
and determine the lat/lon values of any point on the map, I will take a 
snapshot of the map image and draw symbols on it that will represent 
geophysical data.

You can download the demo at:
http://earthlearningsolutions.org/google-static-maps-demo/ 



Well... erm... not quite sure what I've got going on here.

I picked up an api key from Google, but I couldn't paste it into the 
text field. And I couldn't enter more than one character manually. I 
finally brought up the property editor a couple of times until I could 
get rid of the single character and then type the api key into the field 
one character at a time. That seemed to work.


Went out of edit mode and tried to click on the map. That triggered a 
script error, so I figured it needed to do some setup stuff (loading 
libraries, etc) with the api key in place. I saved the stack and quit 
and reloaded the IDE. I launched the stack again and clicked the 'load 
map' button. That triggered a series of errors to the point where I 
finally had to disable messages and shut it all down.


Obviously I'm missing out on something, but I'm not sure what.
But it looks like a promising app.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
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: Google Static Maps Demo Available

2017-07-06 Thread William Prothero via use-livecode
Mark:
H…. I checked it out and the problem is with LC 9.0 (dp7). The openstack 
script is in the first card in the main stack. It has the script to start using 
the various substacks that are needed. If I open it in LC9, this code somehow 
gets disabled and doesn’t show in the IDE editor. So, the substacks never get 
“used.” I tried opening a virgin version in LC 8.1.5(RC3) and it worked as 
expected. So, I guess this is a bug in the latest LC9 release.

I don’t know about the difficulty entering the APIKey. It works for me in 
LC8.1.5. lI’m on Mac, latest OS.

The link to get the latest (fixed) download is:
http://earthlearningsolutions.org/google-static-maps-demo/ 


You need to get this newest version, because I had tested it in LC9 and saved 
it, so the openstack script was deleted somehow.

I’ll be very interested to see if you have more troubles.

Best,
Bill

> On Jul 6, 2017, at 7:20 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 07/06/2017 05:31 PM, William Prothero via use-livecode wrote:
>> Folks:
>> Thanks to help from Hermann, I am sharing a demo stack that accesses the 
>> Google Static Maps API to display maps. This API allows me to display a 
>> terrain map, and determine the lat/lon values of any point on the map, I 
>> will take a snapshot of the map image and draw symbols on it that will 
>> represent geophysical data.
>> You can download the demo at:
>> http://earthlearningsolutions.org/google-static-maps-demo/ 
>> 
> 
> Well... erm... not quite sure what I've got going on here.
> 
> I picked up an api key from Google, but I couldn't paste it into the text 
> field. And I couldn't enter more than one character manually. I finally 
> brought up the property editor a couple of times until I could get rid of the 
> single character and then type the api key into the field one character at a 
> time. That seemed to work.
> 
> Went out of edit mode and tried to click on the map. That triggered a script 
> error, so I figured it needed to do some setup stuff (loading libraries, etc) 
> with the api key in place. I saved the stack and quit and reloaded the IDE. I 
> launched the stack again and clicked the 'load map' button. That triggered a 
> series of errors to the point where I finally had to disable messages and 
> shut it all down.
> 
> Obviously I'm missing out on something, but I'm not sure what.
> But it looks like a promising app.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> ___
> 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: Google Static Maps Demo Available

2017-07-06 Thread Mark Wieder via use-livecode

On 07/06/2017 07:53 PM, William Prothero via use-livecode wrote:

Mark:
H…. I checked it out and the problem is with LC 9.0 (dp7). The openstack 
script is in the first card in the main stack. It has the script to start using 
the various substacks that are needed. If I open it in LC9, this code somehow 
gets disabled and doesn’t show in the IDE editor. So, the substacks never get 
“used.” I tried opening a virgin version in LC 8.1.5(RC3) and it worked as 
expected. So, I guess this is a bug in the latest LC9 release.

I don’t know about the difficulty entering the APIKey. It works for me in 
LC8.1.5. lI’m on Mac, latest OS.

The link to get the latest (fixed) download is:
http://earthlearningsolutions.org/google-static-maps-demo/ 


You need to get this newest version, because I had tested it in LC9 and saved 
it, so the openstack script was deleted somehow.

I’ll be very interested to see if you have more troubles.


Thanks. That fixed all those problems (LC9dp6). No idea what was going 
on with the text field.


So I can load a map, and I can use the slider to zoom. I can type input 
parameters into the centering fields and the box corners and reload the 
map to see the changes, and I can see the mouse lat/lon values moving 
when I move the mouse. Is anything else supposed to happen? Clicking on 
the map does nothing. I realize the docs say 'The rest is pretty 
self-explanatory', so maybe I've done it all.


--
 Mark Wieder
 ahsoftw...@gmail.com


___
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: Google Static Maps Demo Available

2017-07-06 Thread William Prothero via use-livecode
Mark:
Yes, you’ve done it all. It was intended just to demo the display of a Google 
Static Map and show how to get the corners of the image so the lat/lon of the 
mouse position could be calculated. To do that, I had to rely oh Hermann’s 
expertise with Javascript to convert a posted solution to LCS. I spent time 
carefully checking that the corners calculation agreed with the box plotted by 
the maps api. The map image is also slightly stretched horizontally (to fit my 
own project map size) and I had to do some tweaking to the corners code to make 
that work.

The links to the Google API get the programmer to the web site that tells how 
to display streets, display a map of a particular city or other feature, add 
symbols, etc. For those who need to do that, this should help. It’s pretty 
trivial to change the URL params, so I felt I could leave that to the user. 
Actually, the entire thing is pretty trivial, but it did take me quite a bit of 
time, thrashing through the details because I’d never worked with the Google 
maps api, so perhaps others might find it useful.

My project will continue and plot data on a captured image, scroll the map, 
etc. I hadn’t planned on including that part in the demo, but could, if 
requested.

Best,
Bill P

> On Jul 6, 2017, at 9:40 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 07/06/2017 07:53 PM, William Prothero via use-livecode wrote:
>> Mark:
>> H…. I checked it out and the problem is with LC 9.0 (dp7). The openstack 
>> script is in the first card in the main stack. It has the script to start 
>> using the various substacks that are needed. If I open it in LC9, this code 
>> somehow gets disabled and doesn’t show in the IDE editor. So, the substacks 
>> never get “used.” I tried opening a virgin version in LC 8.1.5(RC3) and it 
>> worked as expected. So, I guess this is a bug in the latest LC9 release.
>> I don’t know about the difficulty entering the APIKey. It works for me in 
>> LC8.1.5. lI’m on Mac, latest OS.
>> The link to get the latest (fixed) download is:
>> http://earthlearningsolutions.org/google-static-maps-demo/ 
>> 
>> You need to get this newest version, because I had tested it in LC9 and 
>> saved it, so the openstack script was deleted somehow.
>> I’ll be very interested to see if you have more troubles.
> 
> Thanks. That fixed all those problems (LC9dp6). No idea what was going on 
> with the text field.
> 
> So I can load a map, and I can use the slider to zoom. I can type input 
> parameters into the centering fields and the box corners and reload the map 
> to see the changes, and I can see the mouse lat/lon values moving when I move 
> the mouse. Is anything else supposed to happen? Clicking on the map does 
> nothing. I realize the docs say 'The rest is pretty self-explanatory', so 
> maybe I've done it all.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> 
> ___
> 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: Google Static Maps Demo Available

2017-07-07 Thread hh via use-livecode
Hi William,

this is a great demo, especially your (clever) library functions.

It works all fine here and it is really the base one needs for getting
everything else through the GMap APIs.
Of course, every LC user from all over the world who is not used to work
with numeric coords would be happy to have a basic map scroll.

Thanks for this demo. It was worth to translate the few js lines for that!

Hermann

___
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: Google Static Maps Demo Available

2017-07-07 Thread Mark Wieder via use-livecode

On 07/06/2017 10:33 PM, William Prothero via use-livecode wrote:

Mark:
Yes, you’ve done it all.


Cool. It's working as expected then.

 It was intended just to demo the display of a Google Static Map and 
show how to get the corners of the image so the lat/lon of the mouse 
position could be calculated. To do that, I had to rely oh Hermann’s 
expertise with Javascript to convert a posted solution to LCS. I spent 
time carefully checking that the corners calculation agreed with the box 
plotted by the maps api. The map image is also slightly stretched 
horizontally (to fit my own project map size) and I had to do some 
tweaking to the corners code to make that work.


The links to the Google API get the programmer to the web site that tells how 
to display streets, display a map of a particular city or other feature, add 
symbols, etc. For those who need to do that, this should help. It’s pretty 
trivial to change the URL params, so I felt I could leave that to the user. 
Actually, the entire thing is pretty trivial, but it did take me quite a bit of 
time, thrashing through the details because I’d never worked with the Google 
maps api, so perhaps others might find it useful.

My project will continue and plot data on a captured image, scroll the map, 
etc. I hadn’t planned on including that part in the demo, but could, if 
requested.


The demo doesn't seem to be trivial at all, especially looking at the 
libraries involved - you've put a lot of work into that.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
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: Google Static Maps Demo Available

2017-07-07 Thread Jonathan Lynch via use-livecode
Hey guys - just a quick warning about google. Read their TOS very carefully 
before building an app around their service. One can find several horror 
stories online about Google cancelling contracts without really explaining why.

Bill's stack should work well with a little bit of adaptation for bing maps and 
OSM providers.


Sent from my iPhone

> On Jul 7, 2017, at 10:36 AM, Mark Wieder via use-livecode 
>  wrote:
> 
>> On 07/06/2017 10:33 PM, William Prothero via use-livecode wrote:
>> Mark:
>> Yes, you’ve done it all.
> 
> Cool. It's working as expected then.
> 
> It was intended just to demo the display of a Google Static Map and show how 
> to get the corners of the image so the lat/lon of the mouse position could be 
> calculated. To do that, I had to rely oh Hermann’s expertise with Javascript 
> to convert a posted solution to LCS. I spent time carefully checking that the 
> corners calculation agreed with the box plotted by the maps api. The map 
> image is also slightly stretched horizontally (to fit my own project map 
> size) and I had to do some tweaking to the corners code to make that work.
>> The links to the Google API get the programmer to the web site that tells 
>> how to display streets, display a map of a particular city or other feature, 
>> add symbols, etc. For those who need to do that, this should help. It’s 
>> pretty trivial to change the URL params, so I felt I could leave that to the 
>> user. Actually, the entire thing is pretty trivial, but it did take me quite 
>> a bit of time, thrashing through the details because I’d never worked with 
>> the Google maps api, so perhaps others might find it useful.
>> My project will continue and plot data on a captured image, scroll the map, 
>> etc. I hadn’t planned on including that part in the demo, but could, if 
>> requested.
> 
> The demo doesn't seem to be trivial at all, especially looking at the 
> libraries involved - you've put a lot of work into that.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> ___
> 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: Google Static Maps Demo Available

2017-07-07 Thread William Prothero via use-livecode
I just uploaded a new version, with a few minor tweaks to my Google static maps 
demo stack, at Hermann’s suggestions (same link address I sent previously). You 
don’t need to get a Google APIKey anymore, but will need it for a real app.

If anybody would like to modify it to work with Bing maps or OSM, that would be 
great and I’d like to see it. Be careful, though, as a critical need, for my 
intended purpose, is to have the lat/lon values of the corners of the displayed 
map. The calculations that work for Google may not work for the other map 
services. For apps that generate a gazillion hits, you may have to pay, too.

Best,
Bill P

> On Jul 7, 2017, at 7:59 AM, Jonathan Lynch via use-livecode 
>  wrote:
> 
> Hey guys - just a quick warning about google. Read their TOS very carefully 
> before building an app around their service. One can find several horror 
> stories online about Google cancelling contracts without really explaining 
> why.
> 
> Bill's stack should work well with a little bit of adaptation for bing maps 
> and OSM providers.
> 
> 
> Sent from my iPhone
> 
>> On Jul 7, 2017, at 10:36 AM, Mark Wieder via use-livecode 
>>  wrote:
>> 
>>> On 07/06/2017 10:33 PM, William Prothero via use-livecode wrote:
>>> Mark:
>>> Yes, you’ve done it all.
>> 
>> Cool. It's working as expected then.
>> 
>> It was intended just to demo the display of a Google Static Map and show how 
>> to get the corners of the image so the lat/lon of the mouse position could 
>> be calculated. To do that, I had to rely oh Hermann’s expertise with 
>> Javascript to convert a posted solution to LCS. I spent time carefully 
>> checking that the corners calculation agreed with the box plotted by the 
>> maps api. The map image is also slightly stretched horizontally (to fit my 
>> own project map size) and I had to do some tweaking to the corners code to 
>> make that work.
>>> The links to the Google API get the programmer to the web site that tells 
>>> how to display streets, display a map of a particular city or other 
>>> feature, add symbols, etc. For those who need to do that, this should help. 
>>> It’s pretty trivial to change the URL params, so I felt I could leave that 
>>> to the user. Actually, the entire thing is pretty trivial, but it did take 
>>> me quite a bit of time, thrashing through the details because I’d never 
>>> worked with the Google maps api, so perhaps others might find it useful.
>>> My project will continue and plot data on a captured image, scroll the map, 
>>> etc. I hadn’t planned on including that part in the demo, but could, if 
>>> requested.
>> 
>> The demo doesn't seem to be trivial at all, especially looking at the 
>> libraries involved - you've put a lot of work into that.
>> 
>> -- 
>> Mark Wieder
>> ahsoftw...@gmail.com
>> 
>> ___
>> 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