This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="map"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{ | |
background-color:#f1f1f1; | |
} | |
#map{ | |
width:100%; | |
height:400px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
//creating an object literal containing the properties | |
var options = { | |
zoom: 3, | |
center: new google.maps.LatLng(37.09, -95.71), | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
} | |
//creating the map | |
var map = new google.maps.Map(document.getElementById('map'), options) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>A blank HTML5 page</title> | |
<meta charset="utf-8" /> | |
<!--linked the stylsheet--> | |
<link rel="stylesheet" type="text/css" href="style.css" /> | |
<!--included jquery from remote server--> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> | |
<!-- include the google maps api sensor => false--> | |
<script type="text/javascript" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
//creating an object literal containing the properties | |
var options = { | |
zoom: 3, | |
center: new google.maps.LatLng(37.09, -95.71), | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
//creating the map | |
var map = new google.maps.Map(document.getElementById('map'), options); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var marker = new google.maps.Marker({ | |
//this is just telling where on the map to drop the marker | |
position: new google.maps.LatLng(40.7257,-74.0047), | |
//tells which map to add it to. We named the map, map earlier | |
map:map, | |
//add title | |
title:'this marker is not draggable' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//now lets make a dragable marker. | |
var marker = new google.maps.Marker({ | |
position: new google.maps.LatLng(40.7257,-75.5447), | |
map:map, | |
draggable:true, | |
title:'this marker is draggable' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use a custom icon. | |
var marker = new google.maps.Marker({ | |
position: new google.maps.LatLng(40.7257,-78.5447), | |
map:map, | |
draggable:true, | |
title:'this marker is draggable too, and you used your own image!!', | |
icon: 'marker1.png' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var infowindow = new google.maps.InfoWindow({ | |
content: 'this is a custom marker! You can drag it!' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create an infobox | |
var infowindow = new google.maps.InfoWindow({ | |
content: 'this is an information box.<br> You can put anything inside of it.' | |
}); |