-
Notifications
You must be signed in to change notification settings - Fork 61
fix(map-server): improve map rendering with retina tiles and style options #264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ochafik
wants to merge
10
commits into
main
Choose a base branch
from
ochafik/fix-map-pixelation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Switch from OSM tiles (256x256) to Carto Voyager basemaps which support @2x retina tiles (512x512) on high-DPI displays. Changes: - Detect window.devicePixelRatio >= 1.5 to identify high-DPI displays - Use @2x suffix for tile URLs on retina displays - Set tileWidth/tileHeight to match actual tile dimensions (512px for retina) - Update CSP to allow *.basemaps.cartocdn.com domain - Keep OSM Nominatim for geocoding (unchanged) Carto Voyager style is free to use and visually similar to OSM.
Add 'style' enum parameter to show-map tool: - 'carto' (default): Smooth Carto Voyager tiles with @2x retina support - 'osm': Classic OpenStreetMap tiles with more detail The style can be changed at runtime via tool input. CSP updated to allow both tile providers.
@modelcontextprotocol/ext-apps
@modelcontextprotocol/server-basic-react
@modelcontextprotocol/server-basic-vanillajs
@modelcontextprotocol/server-budget-allocator
@modelcontextprotocol/server-cohort-heatmap
@modelcontextprotocol/server-customer-segmentation
@modelcontextprotocol/server-scenario-modeler
@modelcontextprotocol/server-system-monitor
@modelcontextprotocol/server-threejs
@modelcontextprotocol/server-wiki-explorer
commit: |
- Add home button to return to initial view from tool input - Update README with style parameter documentation - Update all screenshots via docker E2E tests - Tile style persistence already implemented via localStorage
…tton - Change storage key prefix to 'map:' and use 'default' fallback if no toolId - Always show home button after init (flies to default USA view if no initial bbox) - Add flyTo animation (1.5s) for home button
- Log toolInfo context when getting storage key - Log full state object when persisting/loading - Add logging when no persisted state found
…nput Persisted user panning is now restored instead of using tool input bbox. Tool input bbox is still stored for the home button.
Tool ID changes between calls, so use fixed 'map:viewState' key instead.
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.
Summary
This PR improves map rendering quality on high-DPI displays and adds the ability to choose between tile providers.
Changes
1. Retina tile support for high-DPI displays
devicePixelRatio >= 1.5and loads @2x tiles2. Style parameter to choose tile provider
Added a
styleenum parameter to theshow-maptool:"carto"(default): Smooth Carto Voyager tiles with @2x retina support - cleaner look"osm": Classic OpenStreetMap tiles with more cartographic detailThe style can be switched at runtime via tool input.
Usage
Technical Details
*.basemaps.cartocdn.comand*.openstreetmap.orgdomainstileWidth/tileHeightare kept at default 256 even for @2x tiles (they cover the same geographic area, just with more pixels)Testing