Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
90
rated 0 times [  93] [ 3]  / answers: 1 / hits: 38085  / 13 Years ago, thu, march 1, 2012, 12:00:00

I am using the JS API to display my map.
Here is the code:



<script type=text/javascript>
function initialize() {
var _lat = 10;
var _long = 200;
var myLatlng = new google.maps.LatLng(_lat, _long);
var myOptions = {
center: myLatlng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById(map_canvas),
myOptions);

var image = 'target.png';
var beachMarker = new google.maps.Marker({
position: myLatlng,
map: map,
icon: image
});

beachMarker.setMap(map);
}
</script>


Now i want to remove few things from the map.




  1. Remove the zoom controls + user should not be able to zoom using
    mouse or anything

  2. User should not be able to move around the map using mouse. It
    should stay like a static image

  3. Remove the MAP|SATELLITE option from map.



How do i achieve this.



enter


More From » google-maps

 Answers
9
scrollwheel: false,


This option is used for disable zoom on mouse.



scaleControl: false,


This option is used for disable zoom by scale.



draggable: false,


This option is used for disabling drag.



mapTypeControl: false,


This option will hide map type.



Put them as following:



var myOptions = {
center: myLatlng,
zoom: 15,
mapTypeControl: false,
draggable: false,
scaleControl: false,
scrollwheel: false,
navigationControl: false,
streetViewControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
};

[#87120] Wednesday, February 29, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
raymondd

Total Points: 620
Total Questions: 112
Total Answers: 94

Location: Namibia
Member since Mon, Feb 21, 2022
2 Years ago
raymondd questions
Thu, Apr 22, 21, 00:00, 3 Years ago
Thu, Jul 9, 20, 00:00, 4 Years ago
Thu, Apr 9, 20, 00:00, 4 Years ago
Thu, Jul 25, 19, 00:00, 5 Years ago
;