Added option to submit additional parameter when executing the 'getMapMarkers' action
authorMarcel Werk <burntime@woltlab.com>
Tue, 14 Oct 2014 17:34:24 +0000 (19:34 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 14 Oct 2014 17:34:24 +0000 (19:34 +0200)
wcfsetup/install/files/js/WCF.Location.js

index 25556492273f155552ba35f0d4934511b1f4f13f..908c3f0e56304ad306826f71a6f88e0818d88b29 100644 (file)
@@ -386,6 +386,12 @@ WCF.Location.GoogleMaps.LargeMap = WCF.Location.GoogleMaps.Map.extend({
         */
        _actionClassName: null,
        
+       /**
+        * additional parameters for executing the 'getMapMarkers' action
+        * @var object
+        */
+       _additionalParameters: { },
+       
        /**
         * indicates if the maps center can be set by location search
         * @var WCF.Location.GoogleMaps.LocationSearch
@@ -425,11 +431,12 @@ WCF.Location.GoogleMaps.LargeMap = WCF.Location.GoogleMaps.Map.extend({
        /**
         * @see WCF.Location.GoogleMaps.Map.init()
         */
-       init: function(mapContainerID, mapOptions, actionClassName, locationSearchInputSelector) {
+       init: function(mapContainerID, mapOptions, actionClassName, locationSearchInputSelector, additionalParameters) {
                this._super(mapContainerID, mapOptions);
                
                this._actionClassName = actionClassName;
                this._locationSearchInputSelector = locationSearchInputSelector || '';
+               this._additionalParameters = additionalParameters || { };
                this._objectIDs = [ ];
                
                if (this._locationSearchInputSelector) {
@@ -499,13 +506,13 @@ WCF.Location.GoogleMaps.LargeMap = WCF.Location.GoogleMaps.Map.extend({
                this._proxy.setOption('data', {
                        actionName: 'getMapMarkers',
                        className: this._actionClassName,
-                       parameters: {
+                       parameters: $.extend(this._additionalParameters, {
                                excludedObjectIDs: this._objectIDs,
                                eastLongitude: $northEast.lng(),
                                northLatitude: $northEast.lat(),
                                southLatitude: $southWest.lat(),
                                westLongitude: $southWest.lng()
-                       }
+                       })
                });
                this._proxy.sendRequest();
        },