openlayers / ol2

OpenLayers v2 - deprecated!
Other
1.47k stars 770 forks source link

Declare getParameters in ArgParser control as APIMethod? #1371

Open chrismayer opened 10 years ago

chrismayer commented 10 years ago

Is there a reason why the getParameters function in OpenLayers.Control.ArgParser is not declared as APIMethod? Recently I had the use-case that I had to parse some URL parameters without beeing directly related to the map. Due to the API-Docs there seems to be no function to recieve the URL parameters from an ArgParser control instance. When I had a look into the source file I reconized that there is such a function. Would't it be useful to have it in the API-Docs?

Thanks for any comment.

ahocevar commented 10 years ago

I think OpenLayers.Util.getParameters(url) was meant for this. Would that work for you?

chrismayer commented 10 years ago

Yes @ahocevar , OpenLayers.Util.getParameters(url, options) will do the job. But BTW it is also not declared as APIFunction like most of the functions in OpenLayers.Util. Any special reason for that? Were these utils meant to be used only internally?

Thanks!

ahocevar commented 10 years ago

Good point. I assume that nobody wanted to commit to maintaining stability of this function across versions, so it was never marked APIFunction. These days parsing URL parameters is something that is provided by many general purpose JavaScript libraries.