با سلام
با کد html زیر میتونید آدرس مورد نظر خودتون رو در نقشه Google Map در سایت یا وبلاگ خودتون نمایش بدید.
Html Code:
<!DOCTYPE html>
<html>
<head>
<meta name=”viewport” content=”initial-scale=1.0, user-scalable=no” />
<style type=”text/css”>
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type=”text/javascript” src=”http://maps.google.com/maps/api/js?sensor=false”></script>
<script type=”text/javascript”>
var map;
var pos_W=51.2128300;
var pos_N=35.6997917; //۳۵.۶۹۹۷۹۱۷
function initialize()
{
var latlng = new google.maps.LatLng(pos_N,pos_W);
var myOptions = {
zoom: 13,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById(“map_canvas”), myOptions);
//Santa Monica
createMarker(pos_N,pos_W,’Tehran’);
var bufferOptions = {
strokeColor: “#FF0000”,
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: “#FF0000”,
fillOpacity: 0.35,
map: map,
center: new google.maps.LatLng(pos_N,pos_W),
radius: 5000
};
var cityCircle = new google.maps.Circle(bufferOptions);
//Culver City
// createMarker(34.0211224,-118.3964665,’Culver City’);
}
//Function to create marker
function createMarker(latitude,longitude,title)
{
var markerLatLng = new google.maps.LatLng(latitude,longitude);
var marker = new google.maps.Marker({
position: markerLatLng,
map: map,
title: title
});
}
</script>
</head>
<body onload=”initialize()”>
<div id=”map_canvas” style=”width:100%; height:100%”></div>
</body>
</html>
با تشکر