
function initGoogleStreetviewAdres(container_id, lat, lng, adres) {

    $jq('#' + container_id).gmap3(
      { action: 'init',
          zoom: 14,
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          streetViewControl: true,
          address: '"' + adres + '"'
      });

    $jq('#' + container_id).gmap3({
        action: 'getLatLng',
        address: '"' + adres + '"',
        callback: function (result) {
            if (result) {

                var lat = result[0].geometry.location.lat();
                var lng = result[0].geometry.location.lng();
                var latlng = new google.maps.LatLng(lat, lng);


                $jq('#' + container_id).gmap3(
                      { action: 'init',
                          zoom: 14,
                          mapTypeId: google.maps.MapTypeId.ROADMAP,
                          streetViewControl: true,
                          center: [lat, lng]
                      },
                      { action: 'setStreetView',
                          id: container_id,
                          options: {
                              position: [lat, lng],
                              addressControl: false,
                              pov: {
                                  heading: 0,
                                  pitch: 0,
                                  zoom: 1
                              }
                          }
                      });


            } else {

                initGoogleStreetviewLat_Lng(container_id, lat, lng);

            }
        }
    });

}


function initGoogleStreetviewLat_Lng(container_id, lat, lng) {


    $jq('#' + container_id).gmap3(
            { action: 'init',
                zoom: 14,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                streetViewControl: true
            },
            { action: 'setStreetView',
                id: container_id,
                options: {
                    position: [lat, lng],
                    addressControl: false,
                    pov: {
                        heading: 0,
                        pitch: 0,
                        zoom: 1
                    }
                }
            });

}

