Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initialize() {
- var latlng = new google.maps.LatLng("<%=Html.Encode(Model.Field01.Field01) %>", "<%=Html.Encode(Model.Field01.Field03) %>");
- var myOptions = {
- zoom: 13,
- center: latlng,
- disableDefaultUI: false,
- navigationControl: true,
- navigationControlOptions: {style: google.maps.NavigationControlStyle.ZOOM_PAN},
- navigationControl: true,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- };
- var map = new google.maps.Map(document.getElementById("mapcontainer"), myOptions);
- map.getMinimumResolution = function() { return 6 };
- var marker = new google.maps.Marker({
- position: latlng,
- map: map,
- title: "<%=Model.AccomName %>"
- });
- }
- map.getMinimumResolution = function() { return 6 };
- var mt = map.getMapTypes();
- for (var i=0; i<mt.length; i++) {
- mt[i].getMinimumResolution = function() {return 6;}
- }
- var inProcess = false;
- function onZoomChanged() {
- if (inProcess) return;
- if (gmap.getZoom() > 16) {
- inProcess = true;
- gmap.setZoom(16);
- inProcess = false;
- return
- }
- else if (gmap.getZoom() < 10) {
- inProcess = true;
- gmap.setZoom(10);
- inProcess = false;
- return;
- }
- }
- google.maps.event.addListener(gmap, 'zoom_changed', onZoomChanged);
- <script type="text/javascript>
- var latlng = new google.maps.LatLng(42.3493337, 13.398172299999942);
- var options = {
- zoom: 8,
- minZoom: 6,
- maxZoom: 10,
- center: latlng,
- mapTypeId: google.maps.MapTypeId.TERRAIN
- };
- map = new google.maps.Map(document.getElementById("map_canvas"), options);
- </script>
- google.maps.event.addListener(map, "zoom_changed", function() {
- if (map.getZoom() > 12) map.setZoom(12);
- });
- // force normal maps type
- map.setMapType(G_NORMAL_MAP);
- // define minimum and maximum zoom levels
- G_NORMAL_MAP.getMinimumResolution = function() { return 0; }
- G_NORMAL_MAP.getMaximumResolution = function() { return 19; }
Add Comment
Please, Sign In to add comment