Add option to disable usage of current user location
authorMatthias Schmidt <gravatronics@live.com>
Mon, 23 Mar 2015 17:28:59 +0000 (18:28 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 23 Mar 2015 17:28:59 +0000 (18:28 +0100)
com.woltlab.wcf/option.xml
com.woltlab.wcf/package.xml
com.woltlab.wcf/templates/googleMapsJavaScript.tpl
wcfsetup/install/files/js/WCF.Location.js
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 2746778c074fe3e50b46d3d8bef7ec32dc48c5cc..f3b8b7ccbf28b1b32e072a49831ce02051365683 100644 (file)
@@ -747,6 +747,11 @@ physical:wcf.acp.option.google_maps_type.physical]]></selectoptions>
                                <optiontype>float</optiontype>
                                <defaultvalue>13.4</defaultvalue>
                        </option>
+                       <option name="google_maps_user_location_as_default">
+                               <categoryname>general.system.googleMaps</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>1</defaultvalue>
+                       </option>
                        <!-- /general.system.googleMaps -->
                        
                        <!-- general.mail.general -->
index c46afd4b7996d7d0581fa1bc90be1c9ad6e79dd3..f17ec4d7647195b629e48831d7e5a2daf0151527 100644 (file)
@@ -95,6 +95,7 @@
                <instruction type="template">templates_update.tar</instruction>
                
                <instruction type="language" run="standalone">language/*.xml</instruction>
+               <instruction type="option">option.xml</instruction>
                
                <instruction type="sql">update_212.sql</instruction>
        </instructions>
index e2ce2c0ad8a4608e2b576ac3ab2bf6b9f202b0b7..84fdd5284e70bdd55ae81d22cf92eb78c964c7f5 100644 (file)
@@ -19,7 +19,8 @@
                        type: '{@GOOGLE_MAPS_TYPE}',
                        zoom: {@GOOGLE_MAPS_ZOOM},
                        defaultLatitude: {@GOOGLE_MAPS_DEFAULT_LATITUDE},
-                       defaultLongitude: {@GOOGLE_MAPS_DEFAULT_LONGITUDE}
+                       defaultLongitude: {@GOOGLE_MAPS_DEFAULT_LONGITUDE},
+                       userLocationAsDefault: {@GOOGLE_MAPS_USER_LOCATION_AS_DEFAULT}
                });
                
                {event name='javascriptInit'}
index 046315aa2396e720f884b47a8bad07b243352b86..001b43a6e5d121a46f8d96aa2fde231577f9819c 100644 (file)
@@ -22,7 +22,8 @@ WCF.Location.Util = {
         * @param       integer         timeout
         */
        getLocation: function(callback, timeout) {
-               if (navigator.geolocation) {
+               var $userLocationAsDefault = WCF.Location.GoogleMaps.Settings.get('userLocationAsDefault');
+               if (navigator.geolocation && $userLocationAsDefault !== null && $userLocationAsDefault) {
                        navigator.geolocation.getCurrentPosition(function(position) {
                                callback(position.coords.latitude, position.coords.longitude);
                        }, function() {
index 675454741f1b47314aa3c389b692929a8e6131c9..a02308591d9a835d0a12bfe901f7af14c08960a7 100644 (file)
@@ -1010,6 +1010,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.option.google_maps_enable_double_click_zoom"><![CDATA[Zoom durch Doppelklick zulassen]]></item>
                <item name="wcf.acp.option.google_maps_default_latitude"><![CDATA[Standard-Kartenposition (Breitengrad)]]></item>
                <item name="wcf.acp.option.google_maps_default_longitude"><![CDATA[Standard-Kartenposition (Längengrad)]]></item>
+               <item name="wcf.acp.option.google_maps_user_location_as_default"><![CDATA[Aktuelle Benutzerposition verwenden]]></item>
+               <item name="wcf.acp.option.google_maps_user_location_as_default.description"><![CDATA[Bei der Angabe von Positionen wird die aktuelle Position des Benutzers als Ausgangspunkt auf der Karte verwendet.]]></item>
                <item name="wcf.acp.option.message_sidebar_enable_user_online_marking"><![CDATA[„Benutzer online“-Darstellung für Benutzernamen verwenden]]></item>
                <item name="wcf.acp.option.module_privacy_policy_page"><![CDATA[Datenschutzerklärung aktivieren]]></item>
                <item name="wcf.acp.option.module_privacy_policy_page.description"><![CDATA[Die Datenschutzerklärung informiert Nutzer über die Erfassung personenbezogener Daten.]]></item>
index bd8b6edb7a7d1b71f6394c0c68b505aca5d1feb6..571044b92fb1981bd8807be31c6d9ddae07562f2 100644 (file)
@@ -1009,6 +1009,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.option.google_maps_enable_double_click_zoom"><![CDATA[Enable Zoom by Double-Clicking]]></item>
                <item name="wcf.acp.option.google_maps_default_latitude"><![CDATA[Default Map Position (Latitude)]]></item>
                <item name="wcf.acp.option.google_maps_default_longitude"><![CDATA[Default Map Position (Longitude)]]></item>
+               <item name="wcf.acp.option.google_maps_user_location_as_default"><![CDATA[Use Current User Location]]></item>
+               <item name="wcf.acp.option.google_maps_user_location_as_default.description"><![CDATA[When entering a location, the current location of the user is used as start point on the map.]]></item>
                <item name="wcf.acp.option.message_sidebar_enable_user_online_marking"><![CDATA[Apply “Users Online” markings for usernames]]></item>
                <item name="wcf.acp.option.module_privacy_policy_page"><![CDATA[Enable Privacy Policy Page]]></item>
                <item name="wcf.acp.option.module_privacy_policy_page.description"><![CDATA[Inform users regarding the use of their personal data.]]></item>