How to display your address on Google maps?
Procedure to setup your bussiness, office, identify in addition to store address on Google map
Adding a Google Map to your spider web page is real easy, ane time you've been shown how! That's what I am going to create inward this lesson - I volition teach over each stride of creating a basic Google Map using the JavaScript API.
None of this is specific to Google Maps - it's the solid put down for whatsoever HTML page. Open your text editor in addition to add together this code, in addition to therefore salve the file to your desktop every bit google-maps.html (or whatsoever other filename that ends alongside .html).Your Google Map requires a page chemical cistron inward which to appear; add together a
div
tag to the trunk alongside an id
attribute of map-canvas
. This creates a container that we'll reference afterwards inward the lesson.- Creates a div, in addition to gives it a size.
- Loads the Google Maps JavaScript API v3.
- Creates in addition to displays a Google Map inward the div.
Replace the yellowish marked size and Lat-Lng co-ordinates alongside your Lat-Lng address co-ordinates. I recommend reading the Customizing Google Maps shape next. For inspiration, banking enterprise stand upwards for out around of the applications at morethanamap.com.<!DOCTYPE html>
<html>
<head>
<style>
#map-canvas {
width: 500px;
height: 400px;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
function initialize() {
var mapCanvas = document.getElementById('map-canvas');
var mapOptions = {
center: new google.maps.LatLng(26.909126,83.964749),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(mapCanvas, mapOptions)
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
Belum ada Komentar untuk "How to display your address on Google maps?"
Posting Komentar