Hello Sir
I am not getting maps location for the Google maps
Integration of Google maps using client API and html
Code:-
<!DOCTYPE html>
<html>
<head>
<style>
/* Set the size of the div element that contains the map */
#map {
height: 400px; /* The height is 400 pixels */
width: 100%; /* The width is the width of the web page */
}
</style>
</head>
<body>
<h3>My Google Maps Demo</h3>
<!--The div element for the map -->
<div id="map"></div>
<script>
// Initialize and add the map
function initMap() {
var latitude = parent.Xrm.Page.getAttributes("address1_latitude").getValue();
var longitude = parent.Xrm.Page.getAttributes("address1_longitude").getValue();
var location = {lat: latitude, lng: longitude};
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 4, center: location});
var marker = new google.maps.Marker({position: location, map: map});
}
</script>
<!--Load the API from the specified URL
* The async attribute allows the browser to render the page while the API loads
* The key parameter will contain your own API key (which is not needed for this tutorial)
* The callback parameter executes the initMap() function
-->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCK1NjHz6D1dLmfeEVtkT9KVwctytfmDdo&callback=initMap">;
</script>
</body>
</html>
Let me know if any mistake is there in the code
Thanks
I am not getting maps location for the Google maps
Integration of Google maps using client API and html
Code:-
<!DOCTYPE html>
<html>
<head>
<style>
/* Set the size of the div element that contains the map */
#map {
height: 400px; /* The height is 400 pixels */
width: 100%; /* The width is the width of the web page */
}
</style>
</head>
<body>
<h3>My Google Maps Demo</h3>
<!--The div element for the map -->
<div id="map"></div>
<script>
// Initialize and add the map
function initMap() {
var latitude = parent.Xrm.Page.getAttributes("address1_latitude").getValue();
var longitude = parent.Xrm.Page.getAttributes("address1_longitude").getValue();
var location = {lat: latitude, lng: longitude};
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 4, center: location});
var marker = new google.maps.Marker({position: location, map: map});
}
</script>
<!--Load the API from the specified URL
* The async attribute allows the browser to render the page while the API loads
* The key parameter will contain your own API key (which is not needed for this tutorial)
* The callback parameter executes the initMap() function
-->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCK1NjHz6D1dLmfeEVtkT9KVwctytfmDdo&callback=initMap">;
</script>
</body>
</html>
Let me know if any mistake is there in the code
Thanks