mkeller3 / mapbox-gl-ogc-feature-collection

A small package for requesting geojson from an OGC Feature API endpoint to serve tiles in MapBox/MapLibre.
https://mkeller3.github.io/mapbox-gl-ogc-feature-collection/
MIT License
6 stars 1 forks source link

Howto specify url with query parameters? #1

Open ghost opened 12 months ago

ghost commented 12 months ago

Hi, I need to add (CORS-specific) query parameters to my OGC server urls. How can this be done? If I add them to the options url I get wrong resulting urls (/collection simply added to the end of string...). Thomas

mkeller3 commented 12 months ago

Can you provide an example url?

ghost commented 12 months ago

https://domain.de/maps/55559999-0000-0000-1111-724AEFBE79ED/test?apikey=M7QN7BmFew9SGyOvFz_dnogBzVe8ztVih9Afvac83nM1 This is a (not working) sample base url that shows the scheme.

ghost commented 12 months ago

I just tried:

            let ml_ofc = new OGCFeatureCollection(id, ml_map, {
              url: baseUrl,
              collectionId: id,
              limit: 99999,
              apiKey: apiKey
            });

and that worked. Maybe you can clarify in the description that you can add options that are passed through to the query string.