Skip to content

Commit 67e6f4d

Browse files
authored
gpaa-street-view.js: Migrated.
1 parent a1c7410 commit 67e6f4d

File tree

1 file changed

+3
-45
lines changed

1 file changed

+3
-45
lines changed

experimental/gpaa-street-view.js

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,5 @@
11
/**
2-
* Gravity Perks // GP Address Autocomplete // Add Google Street View
3-
*
4-
* Adds a Google Street View container to the bottom of the map and automatically
5-
* updates the Street View when the user selects an address.
6-
*
7-
* Instructions:
8-
* 1. Install our free Custom JavaScript for Gravity Forms plugin.
9-
* Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
10-
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
2+
* We're no longer using the experimental folder for experimental snippets. 🚧
3+
* You can now find the snippet here:
4+
* https://github.com/gravitywiz/snippet-library/blob/master/gp-address-autocomplete/gpaa-street-view.js
115
*/
12-
13-
window.gform.addAction('gpaa_marker_set', function (opts) {
14-
var panorama = new google.maps.StreetViewPanorama(
15-
document.getElementById('gpaa_street_view_container_' + opts.fieldId),
16-
{
17-
position: opts.map.getCenter(),
18-
pov: {
19-
heading: 34,
20-
pitch: 10,
21-
},
22-
}
23-
);
24-
25-
opts.map.setStreetView(panorama);
26-
});
27-
28-
29-
30-
window.gform.addAction('gpaa_map_initialized', function(map, formId, fieldId) {
31-
var mapSel = '#gpaa_map_container_' + fieldId;
32-
var streetViewSel = '#gpaa_street_view_container_' + fieldId;
33-
34-
if (!$(streetViewSel).length) {
35-
$(mapSel).after('<div id="gpaa_street_view_container_' + fieldId + '" >Select an address to see a street view.</div>');
36-
var divHeight = '500px';
37-
$(streetViewSel).css({
38-
// customize styling properties for the street view container here...
39-
height: divHeight,
40-
lineHeight: divHeight,
41-
backgroundColor: 'lightgray',
42-
marginTop: '1rem',
43-
textAlign: 'center',
44-
verticalAlign: 'middle',
45-
});
46-
}
47-
});

0 commit comments

Comments
 (0)