From: Matthias Schmidt Date: Sun, 11 Jun 2017 06:52:24 +0000 (+0200) Subject: Support many markers in WCF.Location.GoogleMaps.LargeMap._loadMarkers() X-Git-Tag: 3.1.0_Alpha_1~381 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76d16d7f8552fa9845972980d2058186b8e87663;p=GitHub%2FWoltLab%2FWCF.git Support many markers in WCF.Location.GoogleMaps.LargeMap._loadMarkers() Closes #2304 --- diff --git a/wcfsetup/install/files/js/WCF.Location.js b/wcfsetup/install/files/js/WCF.Location.js index 47f8333c1b..04ef50a37c 100644 --- a/wcfsetup/install/files/js/WCF.Location.js +++ b/wcfsetup/install/files/js/WCF.Location.js @@ -442,10 +442,24 @@ WCF.Location.GoogleMaps.LargeMap = WCF.Location.GoogleMaps.Map.extend({ */ _previousSouthWest: null, + /** + * if `true`, the `exludedObjectIds` array will be sent as a JSON string, + * otherwise as an array (default) + * note: be prepared that in the future, only JSON strings might be supported + * @var boolean + */ + _stringifyExcludedObjectIds: false, + /** * @see WCF.Location.GoogleMaps.Map.init() */ init: function(mapContainerID, mapOptions, actionClassName, locationSearchInputSelector, additionalParameters) { + this._stringifyExcludedObjectIds = false; + if (mapOptions && mapOptions.stringifyExcludedObjectIds) { + this._stringifyExcludedObjectIds = mapOptions.stringifyExcludedObjectIds; + delete mapOptions.stringifyExcludedObjectIds; + } + this._super(mapContainerID, mapOptions); this._actionClassName = actionClassName; @@ -526,7 +540,7 @@ WCF.Location.GoogleMaps.LargeMap = WCF.Location.GoogleMaps.Map.extend({ actionName: 'getMapMarkers', className: this._actionClassName, parameters: $.extend(this._additionalParameters, { - excludedObjectIDs: this._objectIDs, + excludedObjectIDs: this._stringifyExcludedObjectIds ? JSON.stringify(this._objectIDs) : this._objectIDs, eastLongitude: $northEast.lng(), northLatitude: $northEast.lat(), southLatitude: $southWest.lat(),