0
votes

I have the following requirement and looking for advice for the best method for implementing bing maps in an Access 2013 application.

  1. Enter an address into a field and have bing maps geocode and return the lat longs.

  2. Apply the lat longs and display a push pin to a bing map embedded in an Access form.

  3. The bing map needs to have controls available (panning, zooming etc...).

I've played around with using the REST services but as far as I can tell you can only use static maps. I've also used various urls (www.bing.com/maps/default.aspx) but you don't get as much control of the display of the map.

I'm just looking for ideas and suggestions for best practices.

2
You need to add a bit more about what you tried, and what type of app you are building (Sharepoint hosted web app or classic Access desktop app?). One way to implement maps in an application is to use the browser control. You will still be limited in what to how you can control the actions in the browser, but you can provide some of the functionality by changing the URL's parameters. - Renaud Bompuis

2 Answers

2
votes

If you are using Access 2013 you could use the Bing Maps Access Web App: http://office.microsoft.com/en-gb/store/bing-maps-for-access-WA104324286.aspx?queryid=4586595d%2D09d8%2D492f%2D9a04%2D9ed2ebefb0b5&css=maps&CTT=1

If you are using older versions of office you can create your own solution using either the Bing Maps WPF or V7 JavaScript control. The JavaScript control is the most widely used control and I would recommend using that one. You can find lots of documentation on it here: http://msdn.microsoft.com/en-us/library/gg427610.aspx

Also, here is a useful interactive SDK: http://www.bingmapsportal.com/ISDK/AjaxV7#CreateMap1

Also, to use Bing Maps you will need to create a Bing Maps account and key. I recommend creating a basic, not a trial key, for development and testing as trial keys expire after 90 days while basic one's done. You can find some information on creating keys here: http://www.microsoft.com/maps/create-a-bing-maps-key.aspx

1
votes

This is going to answer part 2 and 3 of your question. I didn't look for how to get lat/long from an address.

Access forms have the web browser control.

You can build up a URL and set the control source of the browser control. See this MS page for what parameters can be used to build up the URL you want.

For example this, I dropped a textbox and awebbrowser control onto a form. I called the textbox text1 and set the control source for the web browser control to =([text1]). When the form loaded I pasted in this URL

http://www.bing.com/maps/default.aspx?cp=47.677797~-122.122013&lvl=10

It rendered as this

bing map in an Access form with URL bar as a textbox

You could build up your URL, according to how MS wants you to build it up, and how you need to and set it to the "URL bar" textbox.