So here is my code:

<script type="text/javascript">

    var map = null;
    var geocoder = null;
        var address = '<?php echo $row['property_address'] . ', ' . $row
['property_city'] . ', ' . $row['property_state'] . '. ' . $row
['property_zip'];?>';
        var formatted_address = '<?php echo $row['property_address'] . '<br /
>' . $row['property_city'] . ', ' . $row['property_state'] . '. ' .
$row['property_zip'];?>';
        sv_available = true;

        function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setUIToDefault();
                geocoder = new GClientGeocoder();
                if (geocoder) {
                geocoder.getLatLng(
                address,
                function(point) {
                if (!point) {
                        alert(address + " not found");
                } else {
                                        globalpoint = point;
                        map.setCenter(point, 13);
                        prop_marker = new GMarker(point);
                        map.addOverlay(prop_marker);
                        prop_marker.openInfoWindowHtml(formatted_address);
                                        myPOV = {yaw:0,pitch:0};
                                panoramaOptions = { latlng:point, pov:myPOV };
                                myPano = new 
GStreetviewPanorama(document.getElementById
("sv_canvas"), panoramaOptions);
                                GEvent.addListener(myPano, "error", svError);
                                        GEvent.addListener(myPano, 
"initialized", function(location) {
                                                panoLocation = location.latlng;
                                        });
                                        
document.getElementById('property_form').addEventListener
('submit', sv_POV, false);
                }
                }
                        );
        }
      }
        }

        function sv_POV(myPano){
                alert('test');
                document.getElementById('sv_camera_POV').value = 
myPano.getPOV();
        }

        function svError(errorCode){
                if(errorCode == 600){
                        document.getElementById('sv_wrapper').style.display = 
'none';
                        document.getElementById('sv_notice').style.display = 
'none';
                        document.getElementById('sv_error').style.display = 
'block';
                        sv_available = false;
                }

        }


</script>

Now, what I have here is a form name="property_form". Basically, when
someone inputs a property it gives the SV location off the geocoder,
but they need to be able to "walk" to the property and point the
camera at the correct house. What I'm coding right now is the
mechanism to store a corrected SV location and to use that location
instead of the one spat out by the geocoder.

So I added an Event Listener to 'property_form' so that when someone
hits submit function sv_POV is triggered.

Now, I need sv_POV to get the current camera POV and then input that
as a text string into a hidden field in the form (field is
'sv_camera_POV'), which then would be written by PHP into the database
for future use. This is the part that isn't working - nothing is going
into my hidden field and I don't know why.

Thank you for your help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to