Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)


#1 2012-09-28 11:47:52

sysdba
Member
Registered: 2012-09-28
Posts: 1

Map and street view toogle

Hi, can someone help me to setup Google Maps with Street View using Toogle Button from begining to end..
This is my code:

<script type="text/javascript">
                $('#test2').gmap3({
                    action:'init',
                    zoom: 18,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    streetViewControl: false,
                    center: [40.729884, -73.990988]
                    });
                     
                    $('#test2-toggle').click(function(){
                    $('#test2').gmap3({
                    action:'getStreetView',
                    callback:function(panorama){
                    var visible = panorama.getVisible();
                    if (visible) {
                    panorama.setVisible(false);
                    } else {
                    var map = $(this).gmap3('get');
                    panorama.setPosition(map.getCenter());
                    panorama.setPov({
                    heading: 265,
                    zoom:1,
                    pitch:0}
                    );
                    panorama.setVisible(true);
                    }
                    }
                    });
                    });
               </script>
               <input type="button" id="test2-toggle" value="Toggle">

                <div class="whole">
                    <h2>Location on map:</h2>
                      <div id="test2"></div>
                 </div>

And this is not working

I also included:
{{HTML::script('http://maps.google.com/maps/api/js?sensor=false')}}
{{HTML::script('js/gmap3.min.js')}}

Offline

Ads
(server costs 27.50€ per month)


Board footer

Powered by FluxBB