Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Embed Google dynamic map on Access form

Posted on 2014-07-23
2
2,662 Views
Last Modified: 2014-07-23
Google has apparently changed their API for embedding maps. On a Access 2010 I've tried to modify my old map-address function but with no success unfortunately . Is this no longer possible to embed ? (the API key has been left out in the function listing below :)

I'm calling the function with:
Me.WebBrowserMap.Navigate ShowAddressOnMap(Me!Address, Me!PostalCode & " " & Me!City, True)

Function ShowAddressOnMap(StreetAddr As String, CityAddr As String, bEmbed As Boolean) As String
    Dim tmpStr As String
    Dim tmpStr2 As String
    Dim shellcmd As String
   
    tmpStr = "https://www.google.com/maps/embed/v1/place?key={API_Key}&q="
    tmpStr2 = Replace(Replace(Trim(StreetAddr), "  ", " "), " ", "+")
    tmpStr = tmpStr & tmpStr2 & ",+" & Replace(Trim(CityAddr), " ", "+")
   
    Debug.Print tmpStr
    If bEmbed = True Then
        ShowAddressOnMap = tmpStr
    Else
        shellcmd = "C:\Program Files\Internet Explorer\iexplore.exe " & tmpStr
        Shell shellcmd, vbNormalFocus
        ShowAddressOnMap = ""
    End If
End Function
0
Comment
Question by:Bojerne
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40213790
Many people just use a WebBrowser, and then use the URL method to show the map. To do that, add a WebBrowser control to your form, and then set the .Navigate property of that control:

Me.MyWebBrowserControl.Object.Navigate = "Full URL for location"

This site seems to list all the parameters you can include in that URL:

http://querystring.org/google-maps-query-string-parameters/
0
 
LVL 1

Author Comment

by:Bojerne
ID: 40213863
Thanks Scott - the link made me realise I had an "embed" parameter in the function (not shown above) - after removing the "embed" paramter it Works ok again :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question