Google map within form to large. (1 Viewer)

earls

Registered User.
Local time
Today, 18:55
Joined
Mar 27, 2018
Messages
21
looking to modify google maps window within an access form. Currently ave a map with location info, interested in the left side only location info as i do not need map. Hoping someone has an idea, I've upload screenshot (blue is what I want to eliminate) and access file along with code. Thanks in advance.
Code:
Private Sub Form_Current()
'Created by Helen Feddema 10-Mar-2010
'Last modified by Helen Feddema 10-Mar-2010

On Error GoTo ErrorHandler

   'Create a Street Address variable with spaces between words
   'replaced by Plus signs
   strStreetAddress = Replace(Nz(Me![txtStreetAddress].Value), " ", "+")
   Debug.Print "Street address for Google URL: " & strStreetAddress
   
   'Create a Whole Address variable with address components separated
   'by Plus signs
   strWholeAddress = strStreetAddress _
      & "+" & Replace(Nz(Me![txtCity].Value), " ", "+") _
      & "+" & Nz(Me![txtStateOrProvince].Value) _
      & "+" & Nz(Me![txtPostalCode].Value)
   Debug.Print "Whole address for Google URL: " & strWholeAddress
      
   'Create Google Map URL by sandwiching Whole Address variable between
   'strings of Google URL code
   strGoogleMapURL = _
      "http://maps.google.com/maps?q=" & strWholeAddress _
' i know the following line needs code to deactivate right side of of map window
      & "&iwloc=A &hl=en"
   Debug.Print "Google URL: " & strGoogleMapURL
   Set appBrowser = Me![ocxWebBrowser]
   Me![ocxWebBrowser].Navigate strGoogleMapURL
   
ErrorHandlerExit:
   Set appBrowser = Nothing
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number _
      & " in Form_Current procedure; " _
      & "Description: " & Err.Description
   Resume ErrorHandlerExit

End Sub
 

Attachments

  • Capture.jpg
    Capture.jpg
    87 KB · Views: 294
  • accarch193.zip
    533.6 KB · Views: 310

isladogs

MVP / VIP
Local time
Today, 23:55
Joined
Jan 14, 2017
Messages
18,239
I'm not sure it's possible or indeed why you'd want a google 'map' without the map.
Have you checked the developers guide for the JavaScript maps api?
 

earls

Registered User.
Local time
Today, 18:55
Joined
Mar 27, 2018
Messages
21
I'm not sure it's possible or indeed why you'd want a google 'map' without the map.
Have you checked the developers guide for the JavaScript maps api?

The access program ties into a PowerApps app that utilizes GPS to navigate employees to customer’s home for pick-up and transport to dr. offices. Problem is human error when creating new customer or destination records (typing errors with addresses, Names), the left window of maps allows me to search and copy/paste address info from google as they have them listed along with phone number, business hours, Dr/office name. The left panel is extremely useful when dealing with Dr. offices.
I have played around with google api but seems like overkill to start from scratch when it could be something simple that I'm missing.
 

MrHans

Registered User
Local time
Tomorrow, 00:55
Joined
Jul 27, 2015
Messages
147
Would hiding it be an option by placing some kind of image of square on top of it?

How about the Google Places API?
It may provide the info you are looking for without the map.
 

isladogs

MVP / VIP
Local time
Today, 23:55
Joined
Jan 14, 2017
Messages
18,239
Would hiding it be an option by placing some kind of image of square on top of it?

How about the Google Places API?
It may provide the info you are looking for without the map.

Similarly you could reduce the width of the web browser window
I thought about both of those options but as the left pane can be minimised, the map would still be shown.

Surely if the address details are wrongly entered, Google maps won't find the correct location anyway

The Places API is certainly worth looking into.
This is an example of nearby places info close to a specified UK postcode



NOTE:
The map with boundary circle & markers is done separately using the Google static maps API
 

Attachments

  • Capture.jpg
    Capture.jpg
    100.4 KB · Views: 471

MrHans

Registered User
Local time
Tomorrow, 00:55
Joined
Jul 27, 2015
Messages
147
Nicely done there Colin

They also provide the opening hours where the op was interested in
 

isladogs

MVP / VIP
Local time
Today, 23:55
Joined
Jan 14, 2017
Messages
18,239
They do indeed ... and much more e.g. details for a selected place

 

Attachments

  • Capture.jpg
    Capture.jpg
    101.7 KB · Views: 455

earls

Registered User.
Local time
Today, 18:55
Joined
Mar 27, 2018
Messages
21
They do indeed ... and much more e.g. details for a selected place


Thanks for the input all, I’m going to try and do more research modifying current setup. If I don’t find a solution tomorrow I will start on building something in google places api. Colin thanks for visual it’s given me a true idea what places api can do.
 

isladogs

MVP / VIP
Local time
Today, 23:55
Joined
Jan 14, 2017
Messages
18,239
You're welcome.
You will need to be able to parse and transform JSON files to make effective use of that api. Good luck
 

MrHans

Registered User
Local time
Tomorrow, 00:55
Joined
Jul 27, 2015
Messages
147

isladogs

MVP / VIP
Local time
Today, 23:55
Joined
Jan 14, 2017
Messages
18,239
Actually, the good thing about the Google API is that you can choose between XML and JSON output.

The XML output is much easier to parse in VBA.
I have used the tutorial linked below that makes parsing these results extremely simple, with some very clean code. I would definitely recommend using this XML instead of JSON.

https://www.myengineeringworld.net/...-distance-function-google-directions-api.html

Hans
We'll have to disagree on that point.
I started using XML output with Google APIs before moving to JSON.
As you rightly say, both are available for many/all their APIs

It's true that you can more easily import XML than JSON but we both know that can be overcome.
Once imported, I find JSON easier to parse.

Thanks for the link by the way - it has a neat function for getting elevation as well
 
Last edited:

Users who are viewing this thread

Top Bottom