Re: Google Static Maps Problem

2017-07-01 Thread prothero--- via use-livecode
Hermann, I'll definitely share a demo. Re a LC Global talk, I'm unable to commit full day slots this summer, so sorry for that. I'm hoping I can get some of the new techniques and info from future docs and discussions and, except for this Google maps issue, I'm on top of my project. Thanks agai

Re: Google Static Maps Problem

2017-07-01 Thread hh via use-livecode
@Bill. No thank for that. I started to work with javascript in November 2016 when the HTML5 standalone builder introduced "do as javascript". It was now a good exercise because your javascript source is by an expert, written very clear and clean. Please show us your final product (doesn't matter i

Re: Google Static Maps Problem

2017-07-01 Thread William Prothero via use-livecode
Hermann: This is looking really good! I will be doing more testing as I integrate it into my project, but at this stage, it is behaving as expected. Thanks so much. Hoping I can repay you in some way. Let me know. Best, Bill P > On Jun 30, 2017, at 8:58 PM, prothero--- via use-livecode > wrot

Re: Google Static Maps Problem

2017-06-30 Thread prothero--- via use-livecode
Herman, I can't begin to tell you how much I appreciate you doing this! Thanks so much!! I'm off my computer for the day, but will run it through its paces tomorrow. Thanks again! Bill P William Prothero http://es.earthednet.org > On Jun 30, 2017, at 8:27 PM, hh via use-livecode > wrote: >

Re: Google Static Maps Problem

2017-06-30 Thread hh via use-livecode
Sorry all, I'm used to work in the forums where one can easily edit posts to remove errors and typos. So here another correction, a constant (pixelsPerLonRadian) was wrong in the first two versions above. My last version, hope it's all correct now: local MERCATOR_RANGE=256, pixelOrigin, pixelsPe

Re: Google Static Maps Problem

2017-06-30 Thread hh via use-livecode
William, sorry I made a mistake, you have to replace "log10" by "ln". Hermann = Here the full correct script: local MERCATOR_RANGE=256, pixelOrigin, pixelsPerLonDegree, pixelsPerLonRadian on mouseUp put (55.9537534, -3.1988236) into centerPoint -- LC Home put 10 into zom -- zo

Re: Google Static Maps Problem

2017-06-30 Thread hh via use-livecode
This is the LC translation of the linked javascript from stackoverflow: (I checked and simplfied a little bit the math, the Mercator projection is OK, very clever there!): It works here, happy mapping: local MERCATOR_RANGE=256, pixelOrigin, pixelsPerLonDegree, pixelsPerLonRadian on mouseUp put

Re: Google Static Maps Problem

2017-06-30 Thread William Prothero via use-livecode
Whoops! Spoke too soon. It puts a box on the map, which is centered on the box, but the map bounds are outside of the box I specified. Still looking. Bill > On Jun 30, 2017, at 6:12 PM, William Prothero via use-livecode > wrote: > > Jonathon and hh: > Ok, it looks like I’ve made some progress

Re: Google Static Maps Problem

2017-06-30 Thread William Prothero via use-livecode
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 corne

Re: Google Static Maps Problem

2017-06-30 Thread Jonathan Lynch via use-livecode
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 tha

Re: Google Static Maps Problem

2017-06-30 Thread Jonathan Lynch via use-livecode
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 > wrote: >

Re: Google Static Maps Problem

2017-06-30 Thread William Prothero via use-livecode
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.

Re: Google Static Maps Problem

2017-06-30 Thread hh via use-livecode
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 __

Re: Google Static Maps Problem

2017-06-30 Thread prothero--- via use-livecode
Jonathon. In the stack I sent, I display the xml from the maps API, that includes the bounds. I'm confused, tho, by the lack of any change when I change the zoom level. Perhaps I'm not calling it with the proper parameters. I like the static maps API because it gives me an image that I can disp

Re: Google Static Maps Problem

2017-06-30 Thread Jonathan Lynch via use-livecode
The google maps API has a function for getting the bounds of a map, which adjusts at each level. So, this is just a matter of calling on that function every time, so you get current bounds. I will look at the stack later today. Just be careful with bounds. They can cause confusion with changes

Re: Google Static Maps Problem

2017-06-30 Thread William Prothero via use-livecode
Jonathan: Here is a link to my test stack and some files I found that have various code to find the corners of the downloaded map. https://www.dropbox.com/s/8xle2hrltx9ll0d/googleMapsAPiTests.zip?dl=0 My start on a conversion

Re: Google Static Maps Problem

2017-06-30 Thread Jonathan Lynch via use-livecode
Hi Bill, Can you share the LC code and JS you are using? Sent from my iPhone > On Jun 29, 2017, at 9:59 PM, William Prothero via use-livecode > wrote: > > Folks: > I’ve found a way to display an image of a google static map, in my app. It’s > quite easy and well-documented. However, I need

Google Static Maps Problem

2017-06-29 Thread William Prothero via use-livecode
Folks: I’ve found a way to display an image of a google static map, in my app. It’s quite easy and well-documented. However, I need to get the lat and lon values of the corners of the map, at the displayed zoom level. There is a simple-looking javascript example for doing this at: https://stacko