Disable right click script and Google Instant Map Search
<!DOCTYPE html created my solomon >
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Instant Map Search | spixup- demo </title>
<style type="text/css">
#map_canvas{
height: 400px;
width: 500px;
margin: 5px auto;
}
</style>
</head>
<body>
<SCRIPT TYPE="text/javascript">
//-------------Disable right click script ------------
//visit http://www.rainbow.arch.scriptmania.com/scripts/
var message="Sorry, right-click has been disabled";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -------------------end---------------------
</SCRIPT>
Google Instant Map Search
<div id="map_canvas"></div>
<script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAKAqAId-z4dpNB0txHVU_TRSdIo_h9adg_WTTpw2CoBgzP7rIUxRnKu-u9D1O2d2mEH6cCOw-B33tRQ"></script>
<script type="text/javascript">
google.load("jquery", "1.4.3");
google.load("jqueryui", "1.8.5");
</script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder;
var map;
var marker;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(37.7749295, -122.4194155);
var myOptions = {
zoom: 14,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
marker = new google.maps.Marker({
map: map,
draggable: true
});
}
function codeAddress() {
var address = '<?php echo $_GET['addr']; ?>';
//var address = document.getElementById("address").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
}
});
}
$(document).ready(function() {
initialize();
codeAddress();
$("#map_canvas");
});
</script>
</body>
</html>
<!-- Hosting24 Analytics Code -->
<!-- End Of Analytics Code -->
Comments
Post a Comment