UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Open Map, Set Pushpin, Add Pushpin Lat/lng To Recordset?, Access 2016    
 
   
mminieri
post Jul 11 2018, 02:03 AM
Post#1



Posts: 2
Joined: 8-July 18



I have a database project (in MS Access 2016) and wish to add a mapping feature with the following functionality (via VBA is preferred);

1 – Create a FORM that includes display of a street map of a specific small city overall view (I can get the desired starting URL from Google or Bing maps). This can fill on Open or via a command button.

2 – The user manipulates that map’s controls in order to locate a target point that they desire, and manually MARK (such as by pushpin) that point.

3 – After marking the point they can press a command button which will then acquire the latitude and longitude of the point so marked (pushpin) and store that data in the current recordset. If that marked map image can be stored as a .jpg or similar, that would be a “bonus”.

4 – On the REPORT associated with that recordset, I would like to include a subREPORT that is an image of that map showing that pushpin…… either using the SAVED .jpg image OR created dynamically at Preview/Print so that it appears in the printed REPORT (whichever method is easier to code).
Go to the top of the page
 
JonSmith
post Jul 11 2018, 02:56 AM
Post#2



Posts: 3,831
Joined: 19-October 10



Thats extremely ambitious.
So there are web call API's to Google Maps afaik but they typically require you to get a licence. I dont think thats what you want though.
It sounds like you want to load up the webpage embedded in a form and then get the user to interact with it and then save the results.

Embedding a webpage into an Access page is typically, problematic, although possible, you'd need to mess with registry settings though to ensure it emulates an IE version that supports Google maps.

Then once you did that I don't see what you cannot browse to a target, I wonder how to get the latitude and longitude? When I use Google maps in Chrome the URL only changes if I zoom or scroll, dropping a pin doesn't provide the lat and long.
Perhaps there is a way I haven't Googled it. This might be the hardest task, it might not be possible in Access.

Saving the Map is actually not that hard at all. Allen Browne developed a 'picturebox' thing a long time ago and I have done some work modifying it.
I can't remember the specifics of his version but I made it so it would take a screenshot of a specific region of the screen, in my instance taking a screenshot of a scaled image in order to make a thumbnail. (I had a database where you could scroll through thumbnails of images but the high res versions loaded slowly so I wanted thumbnails of them). This could easily be adapted to take a screenshot of the currently displayed webpage. (I've actually been meaning to look at it for a while, I made it whilst I was much more amateur and I've played around with the idea of using it to screencap errors).

I'd suggest start at seeing if you can scrape the lat and long. Thats the biggest question mark.
Go to the top of the page
 
isladogs
post Jul 11 2018, 03:01 AM
Post#3



Posts: 469
Joined: 4-June 18



Have a look at these two example databases and see if you can adapt them
UK Postcodes, Get Current Geolocation

--------------------
nil illigetimi carborundem est
Go to the top of the page
 
JonSmith
post Jul 11 2018, 06:01 AM
Post#4



Posts: 3,831
Joined: 19-October 10



isladogs, both those links go to the same page, seems the UK postcodes one was repeated.

Looks like a great start for embedding a map though. It 'Get Current Geolocation' does what it sounds like it would add a big piece to its puzzle.
Go to the top of the page
 
GroverParkGeorge
post Jul 11 2018, 08:17 AM
Post#5


UA Admin
Posts: 33,502
Joined: 20-June 02
From: Newcastle, WA


Thanks for the links. I have a personal use project underway that might be able to take advantage of these apis. I'll post back in a couple of weeks how it turns out.

Hm. I guess I hadn't logged into AWF for a while. They forgot who I am.
This post has been edited by GroverParkGeorge: Jul 11 2018, 08:20 AM

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Visit My Blog on Facebook
Go to the top of the page
 
isladogs
post Jul 11 2018, 12:52 PM
Post#6



Posts: 469
Joined: 4-June 18



Sorry.
Here's the correct link for the second item Get Current Geolocation

--------------------
nil illigetimi carborundem est
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    23rd September 2018 - 01:28 AM