From 5c298a18edd94022c57c7687e4995d9cc6806b24 Mon Sep 17 00:00:00 2001 From: Brian Holland Date: Wed, 23 Feb 2011 19:44:53 +0000 Subject: Tidy up the Google Street View setup. (Much Simpler now, and with no extraneous warning messages anywhere) --- modules/googlemap/placehierarchy.php | 101 +++----- modules/googlemap/places_edit.php | 9 - modules/googlemap/wt_v3_street_view.php | 31 ++- modules/googlemap/wt_v3_street_view_setup.php | 347 -------------------------- 4 files changed, 52 insertions(+), 436 deletions(-) delete mode 100644 modules/googlemap/wt_v3_street_view_setup.php diff --git a/modules/googlemap/placehierarchy.php b/modules/googlemap/placehierarchy.php index 15629ac62f..2329c0f21f 100644 --- a/modules/googlemap/placehierarchy.php +++ b/modules/googlemap/placehierarchy.php @@ -167,20 +167,6 @@ function create_map() { ->execute(array($levelm)) ->fetch(PDO::FETCH_ASSOC); - if (!isset($latlng)) { - // ? - } else { - if ($latlng['sv_lati']==null && WT_USER_IS_ADMIN && $STREETVIEW && $level > 0) { - echo '
', WT_I18N::translate('No Street View coordinates are saved yet.'), '

'; - echo '
'; - } - } - echo '
"; echo ''; @@ -253,60 +239,39 @@ function create_map() { $sv_zoom = $latlng['sv_zoom']; // StreetView Point of View Zoom (0, 1, 2 or 3) // If Streetview coordinates are stored, bring up the regular Streetview ------- - if ($latlng['sv_lati']!=null) { - $_map = WT_I18N::translate('Google Maps'); - $_reset = WT_I18N::translate('Reset'); - $_streetview = /* I18N: http://en.wikipedia.org/wiki/Google_street_view */ WT_I18N::translate('Google Street View'); - ?> -
- -
- ". - translate_fact('LONG')."". - WT_I18N::translate('Bearing')."". - WT_I18N::translate('Elevation')."". - WT_I18N::translate('Zoom')." - "); - if (WT_USER_IS_ADMIN) { - echo ""; - } else { - echo "
"; - } - echo "\n"; - echo "
\n"; - echo "
"; - echo $list_latlon; - echo ""; - echo "
"; - echo "
\n"; - - // Else, if Admin, bring up StreetView adjustment Map -------------------------- - } else if (WT_USER_IS_ADMIN) { - $sv_lat = $pl_lati; // Place Latitude - $sv_lng = $pl_long; // Place Longitude - ?> - - ". - translate_fact('LONG')."". - /* I18N: compass bearing (in degrees) */ WT_I18N::translate('Bearing')."". - /* I18N: angle of elevation (in degrees) */ WT_I18N::translate('Elevation')."". - WT_I18N::translate('Zoom')." - "); - echo ''; - echo ''; - echo '
'; - echo '
'; - echo $list_latlon; - echo ''; - echo '
'; - echo '
'; - } - } + if ($latlng['sv_lati']==null) { + $sv_lat = $pl_lati; // Place Latitude + $sv_lng = $pl_long; // Place Longitude + } + + $_map = WT_I18N::translate('Google Maps'); + $_reset = WT_I18N::translate('Reset'); + $_streetview = /* I18N: http://en.wikipedia.org/wiki/Google_street_view */ WT_I18N::translate('Google Street View'); + ?> +
+ +
+ + ". + translate_fact('LONG')."". + WT_I18N::translate('Bearing')."". + WT_I18N::translate('Elevation')."". + WT_I18N::translate('Zoom')." + "); + if (WT_USER_IS_ADMIN) { + echo ""; + } else { + echo "
"; + } + echo "\n"; + echo "
\n"; + echo "
"; + echo $list_latlon; + echo ""; + echo "
"; + echo "
\n"; } } // Next line puts Place hierarchy on new row ----- diff --git a/modules/googlemap/places_edit.php b/modules/googlemap/places_edit.php index 11322132fa..5f3b2f4607 100644 --- a/modules/googlemap/places_edit.php +++ b/modules/googlemap/places_edit.php @@ -277,15 +277,6 @@ $api="v3";
- - - - - diff --git a/modules/googlemap/wt_v3_street_view.php b/modules/googlemap/wt_v3_street_view.php index 5d0c484e8a..f4e837865a 100644 --- a/modules/googlemap/wt_v3_street_view.php +++ b/modules/googlemap/wt_v3_street_view.php @@ -124,12 +124,15 @@ function initialize() { style: google.maps.NavigationControlStyle.SMALL // ANDROID, DEFAULT, SMALL, ZOOM_PAN }, streetViewControl: false, // Show Pegman or not - scrollwheel: false + scrollwheel: true }; var map = new google.maps.Map(document.getElementById('mapCanvas'), mapOptions); var bearing = b; + if (bearing < 0) { + bearing=bearing+360; + } var pitch = p; var svzoom = m; @@ -144,16 +147,16 @@ function initialize() { new google.maps.Point(26, 36) ); -// var shape = { -// coord: [1, 1, 1, 20, 18, 20, 18 , 1], -// type: 'poly' -// }; + var shape = { + coord: [1, 1, 1, 20, 18, 20, 18 , 1], + type: 'poly' + }; var marker = new google.maps.Marker({ - //icon: image, - //shape: shape, - //position: latLng, - title: 'Drag me to a Street', + icon: image, + // shape: shape, + position: latLng, + title: 'Drag me to a Blue Street', map: map, draggable: true }); @@ -195,7 +198,7 @@ function initialize() { panorama = new google.maps.StreetViewPanorama(document.getElementById("mapCanvas"), panoramaOptions); panorama.setPosition(latLng); -/* + // Enable navigator contol and address control to be toggled with right mouse button ------- var aLink = document.createElement('a'); aLink.href = "javascript:void(0)"; onmousedown=function(e) { @@ -211,9 +214,11 @@ function initialize() { } if (clickType!=1) { if (panorama.get('addressControl') == false) { + panorama.set('navigationControl', false); panorama.set('addressControl', true); panorama.set('linksControl', true); } else { + panorama.set('navigationControl', false); panorama.set('addressControl', false); panorama.set('linksControl', false); } @@ -228,7 +233,7 @@ function initialize() { }; panorama.controls[google.maps.ControlPosition.TOP_RIGHT].push(aLink); // ----------------------------------------------------------------------------------------- -*/ + // Update current position info. updateMarkerPosition(latLng); @@ -402,7 +407,9 @@ google.maps.event.addDomListener(window, 'load', initialize); -
+
+ +
diff --git a/modules/googlemap/wt_v3_street_view_setup.php b/modules/googlemap/wt_v3_street_view_setup.php deleted file mode 100644 index 0641ab87b2..0000000000 --- a/modules/googlemap/wt_v3_street_view_setup.php +++ /dev/null @@ -1,347 +0,0 @@ - - - - - - Google Maps JavaScript API V3: Street View Layer - - - - - - - -
-
- - -
-
- -
- -
- - - - - -- cgit v1.3