DRAFT: feat(Map): add OpenStreetMap (OSM) provider for dxMap#34041
Open
AlisherAmonulloev wants to merge 4 commits into
Open
DRAFT: feat(Map): add OpenStreetMap (OSM) provider for dxMap#34041AlisherAmonulloev wants to merge 4 commits into
AlisherAmonulloev wants to merge 4 commits into
Conversation
Keyless, Leaflet-based OSM provider (provider: 'osm'). Tiles, geocoding and
routing are supplied by the consumer via providerConfig.{tileServer,
geocodeLocation, getRoute} rather than bundled, so no public OSM tile server is
used by default. Adds errors W1030/W1031/W1032 for missing tile server,
geocode callback and attribution.
- New provider implementation and Leaflet integration
- 'osm' added to MapProvider; providerConfig OSM types in map.d.ts
- Regenerated React/Vue/Angular wrappers and aspnet metadata enum
- React Storybook story (Map/OSM Provider)
- Unit tests with a Leaflet mock
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new provider: 'osm' option for dxMap, implementing an OpenStreetMap provider backed by Leaflet. It introduces OSM-specific providerConfig hooks (tiles/geocoding/routing provided by the consumer), integrates the provider into the core Map widget, updates typings/metadata/wrappers, and adds a Leaflet mock plus QUnit coverage and a React Storybook example.
Changes:
- Added a Leaflet-based OSM dynamic provider and hooked it into
dxMap’s provider registry and option-change pipeline (incl. runtime tileServer updates). - Extended public typings (
MapProvider, OSM callback/types) and propagated the new provider to metadata and framework wrappers. - Added QUnit test coverage for the new provider using a Leaflet mock, plus a React Storybook story demonstrating configuration.
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/ts/dx.all.d.ts | Adds 'osm' to MapProvider and includes OSM-related public types/options in the aggregated typings output. |
| packages/devextreme/js/ui/map.d.ts | Adds 'osm' provider type and introduces public OSM callback/tile server types plus providerConfig fields. |
| packages/devextreme/js/ui/map_types.d.ts | Re-exports newly added OSM public types from ui/map. |
| packages/devextreme/js/ui/widget/ui.errors.js | Adds new warnings W1030/W1031/W1032 for OSM configuration issues. |
| packages/devextreme/js/__internal/ui/map/provider.ts | Adds a default updateTileServer() hook and adjusts apiKey lookup typing for non-keyed providers like osm. |
| packages/devextreme/js/__internal/ui/map/provider.dynamic.ts | Extends geocoding cache typing to support plain {lat,lng} results for OSM. |
| packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.ts | New Leaflet-based OSM provider implementation (tiles, geocoding callback, routing callback + fallback). |
| packages/devextreme/js/__internal/ui/map/map.ts | Registers the osm provider and adds a targeted option-change path for providerConfig.tileServer. |
| packages/devextreme/testing/helpers/forMap/leafletMock.js | New Leaflet mock used by unit tests. |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/mapParts/osmTests.js | New QUnit suite covering OSM loading, options, tiles, markers, routes, and cleanup behavior. |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/map.tests.js | Includes the new OSM test module in the map test entrypoint. |
| packages/devextreme/eslint.config.mjs | Extends spellchecker skipWords for OSM/Leaflet domain terms used by the feature. |
| packages/devextreme-metadata/aspnet/enums.ts | Adds 'osm' to the ASP.NET GeoMapProvider enum metadata. |
| packages/devextreme-react/src/map.ts | Propagates new OSM providerConfig types into the generated React wrapper types. |
| packages/devextreme-vue/src/map.ts | Propagates new OSM providerConfig types/props/emits into the generated Vue wrapper. |
| packages/devextreme-angular/src/ui/nested/provider-config.ts | Adds OSM providerConfig inputs to the generated Angular nested option component. |
| packages/devextreme-angular/src/ui/map/nested/provider-config.ts | Adds OSM providerConfig inputs to the generated Angular map nested option component. |
| packages/devextreme-angular/src/ui/map/index.ts | Extends Angular Map component typing for providerConfig and its change event to include OSM hooks. |
| apps/react-storybook/stories/map/OSMMap.stories.tsx | New Storybook story demonstrating OSM provider configuration with commercial tile providers and OSRM routing. |
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.
Keyless, Leaflet-based OSM provider (provider: 'osm'). Tiles, geocoding and routing are supplied by the consumer via providerConfig.{tileServer, geocodeLocation, getRoute} rather than bundled, so no public OSM tile server is used by default. Adds errors W1030/W1031/W1032 for missing tile server, geocode callback and attribution.