diff --git a/experimental/gpaa-street-view.js b/experimental/gpaa-street-view.js index ca8a95588..372f3592a 100644 --- a/experimental/gpaa-street-view.js +++ b/experimental/gpaa-street-view.js @@ -1,47 +1,5 @@ /** - * Gravity Perks // GP Address Autocomplete // Add Google Street View - * - * Adds a Google Street View container to the bottom of the map and automatically - * updates the Street View when the user selects an address. - * - * Instructions: - * 1. Install our free Custom JavaScript for Gravity Forms plugin. - * Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/ - * 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin. + * We're no longer using the experimental folder for experimental snippets. 🚧 + * You can now find the snippet here: + * https://github.com/gravitywiz/snippet-library/blob/master/gp-address-autocomplete/gpaa-street-view.js */ - -window.gform.addAction('gpaa_marker_set', function (opts) { - var panorama = new google.maps.StreetViewPanorama( - document.getElementById('gpaa_street_view_container_' + opts.fieldId), - { - position: opts.map.getCenter(), - pov: { - heading: 34, - pitch: 10, - }, - } - ); - - opts.map.setStreetView(panorama); -}); - - - -window.gform.addAction('gpaa_map_initialized', function(map, formId, fieldId) { - var mapSel = '#gpaa_map_container_' + fieldId; - var streetViewSel = '#gpaa_street_view_container_' + fieldId; - - if (!$(streetViewSel).length) { - $(mapSel).after('
Select an address to see a street view.
'); - var divHeight = '500px'; - $(streetViewSel).css({ - // customize styling properties for the street view container here... - height: divHeight, - lineHeight: divHeight, - backgroundColor: 'lightgray', - marginTop: '1rem', - textAlign: 'center', - verticalAlign: 'middle', - }); - } -});