Visualizzazione dei risultati da 1 a 2 su 2

Discussione: API Googlemap

  1. #1

    API Googlemap

    Ciao, sto personalizzando una googlemap ma non riesco a far funzionare // ground overlay.


    codice:
       <script type="text/javascript" 
               src="http://maps.google.com/maps/api/js?sensor=false"></script>
    </head> 
    <body>
       <div id="map" style="width: 400px; height: 300px;"></div> 
    
       <script type="text/javascript"> 
    
       // This is the minimum zoom level that we'll allow
       var minZoomLevel = 5;
    
       var map = new google.maps.Map(document.getElementById('map'), {
          zoom: minZoomLevel,
          center: new google.maps.LatLng(38.50, -90.50),
          mapTypeId: google.maps.MapTypeId.ROADMAP
       });
    
       // Bounds for North America
       var strictBounds = new google.maps.LatLngBounds(
         new google.maps.LatLng(28.70, -127.50), 
         new google.maps.LatLng(48.85, -55.90)
       );
    
       // Listen for the dragend event
       google.maps.event.addListener(map, 'dragend', function() {
         if (strictBounds.contains(map.getCenter())) return;
    
         // We're out of bounds - Move the map back within the bounds
    
         var c = map.getCenter(),
             x = c.lng(),
             y = c.lat(),
             maxX = strictBounds.getNorthEast().lng(),
             maxY = strictBounds.getNorthEast().lat(),
             minX = strictBounds.getSouthWest().lng(),
             minY = strictBounds.getSouthWest().lat();
    
         if (x < minX) x = minX;
         if (x > maxX) x = maxX;
         if (y < minY) y = minY;
         if (y > maxY) y = maxY;
    
         map.setCenter(new google.maps.LatLng(y, x));
       });
    
       // Limit the zoom level
       google.maps.event.addListener(map, 'zoom_changed', function() {
         if (map.getZoom() < minZoomLevel) map.setZoom(minZoomLevel);
            });
            
    	// ground overlay
    	var boundaries = new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,179));
        var newmap = new GGroundOverlay("http://www.psdgraphics.com/file/stars.jpg", boundaries);
        map.addOverlay(newmap);
    
    
       </script> 
    </body>
    Grazie
    from MBP17" i7 2.2 or or one of the other 9 Mac
    _______________________________________________
    Domain auctions: liberohotel.com scarrafone.com

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Prosegue nell'altra

    Ok, forse non c'entra un fico con l'altra... ma rimane chiusa per titolo non conforme
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.