Skip to content

Instantly share code, notes, and snippets.

@marcolago
Created May 7, 2014 08:51
Show Gist options
  • Save marcolago/23fffccea1565065c91d to your computer and use it in GitHub Desktop.
Save marcolago/23fffccea1565065c91d to your computer and use it in GitHub Desktop.
Streetview Draggable Pin
<!DOCTYPE html5>
<html">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps V3 API Sample</title>
<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var mapDiv = document.getElementById('map-canvas');
var map = new google.maps.StreetViewPanorama(mapDiv, {
position: new google.maps.LatLng(45.068573, 7.68469)
});
var icon = {};
icon.anchor = new google.maps.Point(10, 200);
icon.url = "https://lh4.googleusercontent.com/-RrXvoicj3bQ/AAAAAAAAAAI/AAAAAAAAAAA/lvioqt_2Sm0/s32-c/photo.jpg";
var marker = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(45.068573, 7.68469),
draggable: true,
icon: icon
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body style="font-family: Arial; border: 0 none;">
<div id="map-canvas" style="width: 500px; height: 400px"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment