Friday, 19 April 2013

Embed Google maps in a form

I had to prove a concept the other day to embed google maps in a form. A big of googling Smile and some ideas that had to mash up.

Create a form with an ActiveX control “Microsoft Web Browser”.

G12013-04-19_1619

On the init method after super call. Add this line.

ctrlactiveX.Navigate('https://maps.google.com.au/maps?q=1 St Georges Terrace, PERTH WA 6000+(This is a random place)&output=embed');

Final result looks like this.
G22013-04-19_1624

Reference:

Thanks to this blog.

http://microsoft-dynamics-ax-erp.blogspot.com.au/2012/01/integrate-google-map-in-dynamics-ax.html

Minor change I had to make was to figure out the URL parameters. By passing the output=embed, you get a pretty good result.

No comments: