Skip to Content
Menu
This question has been flagged
3 Replies
17770 Views

I am trying to get a Google map link to work on Odoo.

http://imgur.com/a/9YWBi screenshot


But no matter what I type there..name of business or GPS coordinates, it doesn't work.


http://imgur.com/a/l0DJE screenshot


Is there a way to get Google maps to open to the correct location?





Avatar
Discard
Best Answer

In order to get google maps you have to generate a google map api.

the instructions are given to the website admin application in odoo10

in order to generate an api you have to follow below steps.

go to website admin--->configuration--->settings

and follow the instructions that are given at that page.

if you cant find the link than copy the bellow link

https://console.developers.google.com/flows/enableapi?apiid=maps_backend,static_maps_backend&keyType=CLIENT_SIDE&reusekey=true

on this page just create a key and paste it in your google api key field that is located in settings of your website admin

the map will be apear at the contact us page of your website

Avatar
Discard
Author

That worked. Thank you

Best Answer

javascript to get google map and image show 


<div id="map" style="width:100%;height:400px;border:3px solid white;"></div>


javascript function

<script> function myMap() { var mapCanvas = document.getElementById("map");

    var myCenter = new google.maps.LatLng(23.2824321,72.641682); var mapOptions = {center: myCenter, zoom: 12};

    var map = new google.maps.Map(mapCanvas,mapOptions);

    var marker = new google.maps.Marker({ position: myCenter, icon: "resources/mark.png" });

    marker.setMap(map);

    google.maps.event.addListener(marker,'click',function() { var infowindow = new google.maps.InfoWindow({ content:"<img src='resources/map.jpg' width='250px' height='150px' border='0'/><br><center><h3>location name</h3></center>" });

    infowindow.open(map,marker);

    });

  } </script> <script src="https://maps.googleapis.com/maps/api/js?callback=myMap&key=key"></script>

Avatar
Discard

Do we need to pay for Map API keys?