CL-5874 Support EU endpoints configuration across SDK - #381
Draft
petrsloup wants to merge 2 commits into
Draft
Conversation
Delegates to the corresponding option in @maptiler/client so the API host is configured in one place. Removes the SDK's own frozen api.maptiler.com constants and routes the remaining host-dependent URLs (caching, tools, Map terrain source, telemetry, logo control, vector layer helpers, image viewer, cubemap layer) through it.
|
Some E2E Tests Failed: Please check the attached artifacts here |
Mirrors the same change in @maptiler/client (PR #116) so both packages stay consistent: apiKey and fetch are already get/set pairs on SdkConfig, so a callable method here was inconsistent.
|
Some E2E Tests Failed: Please check the attached artifacts here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Enable the SDK to dynamically switch between MapTiler's default
.comand EU-based.euAPI endpoints throughout all components that make API requests.Description
This change introduces comprehensive support for EU endpoint configuration by:
Extended config API (
src/config.ts):useEuEndpoints(value?: boolean)method to switch betweenapi.maptiler.comandapi.maptiler.euisUsingEuEndpointsgetter to check current endpoint statusapiHostgetter to retrieve the current hostapiURLgetter to retrieve the current base URLReplaced hardcoded URLs with dynamic config references:
src/Map.ts: Updated terrain source URL and host checks to useconfig.apiURLandconfig.apiHostsrc/helpers/vectorlayerhelpers.ts: Updated dataset feature URLs in polyline, polygon, point, and heatmap functionssrc/Telemetry.ts: Updated telemetry endpoint to useconfig.apiURLsrc/caching.ts: Updated host check to useconfig.apiHostsrc/controls/MaptilerLogoControl.ts: Updated logo URL to useconfig.apiURLsrc/ImageViewer/ImageViewer.ts: Updated image API base path to useconfig.apiURLsrc/custom-layers/CubemapLayer/CubemapLayer.ts: IntroducedgetSpaceImagesBaseUrl()function to dynamically construct space image URLssrc/tools.ts: Updated host check to useconfig.apiHostCleaned up defaults (
src/constants/defaults.ts):Added comprehensive tests (
test/config.test.ts):.comendpoint behavior.euendpointsAcceptance
Checklist
https://claude.ai/code/session_01HF5td6ttnvHZWWFeG9L3Yy