Skip to content
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

fix support for OpenLayers 10.3.1 #347

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [3.3.1] 2025-01-10

- Fix `RLayerVectorImage` in OpenLayers 10.3.1

## [3.3.0] 2025-01-09

- OpenLayers 10.3.1 support
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ module.exports = {
]
},
transformIgnorePatterns: [
'/node_modules/(?!(ol|txml|geotiff|quick-lru|color-|rbush|earcut|pbf|quickselect))'
'/node_modules/(?!(ol|txml|geotiff|quick-lru|color-|rbush|earcut|pbf|quickselect|node-fetch|data-uri-to-buffer|fetch-blob|formdata-polyfill))'
],
moduleNameMapper: {
'^rlayers$': '<rootDir>/src',
'^rlayers/(.*)$': '<rootDir>/src/$1',
'\\.(css|less)$': '<rootDir>/test/css.js',
'^txml/txml$': '<rootDir>/node_modules/txml/dist/txml'
},
setupFiles: ['jest-canvas-mock'],
setupFiles: ['jest-canvas-mock', 'jsdom-worker'],
setupFilesAfterEnv: ['@testing-library/jest-dom', './test/setup_mocks.ts'],
testRegex: '/test/.*\\.test\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
Expand Down
158 changes: 147 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@
"jest": "^29.4.3",
"jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^29.4.3",
"jsdom-worker": "^0.3.0",
"markdown-loader": "^8.0.0",
"null-loader": "^4.0.1",
"ol": "^10.2.0",
"ol": "^10.3.1",
"ol-mapbox-style": "^12.3.5",
"ol-mbtiles": "^3.2.0",
"prettier": "2.8.8",
Expand Down
2 changes: 1 addition & 1 deletion src/layer/RLayerVectorImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class RLayerVectorImage extends RLayerBaseVector<
Feature,
RLayerBaseVectorProps<Feature>
> {
ol: LayerVectorImage<Feature>;
ol: LayerVectorImage<SourceVector<Feature>>;
source: SourceVector<Feature>;

protected createSource(props: Readonly<RLayerBaseVectorProps<Feature>>): BaseObject[] {
Expand Down
3 changes: 3 additions & 0 deletions test/setup_mocks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import proj4 from 'proj4';
import {register} from 'ol/proj/proj4';
import {TextEncoder, TextDecoder} from 'util';

import ResizeObserver from 'resize-observer-polyfill';
window.ResizeObserver = ResizeObserver;

Object.assign(global, {TextDecoder, TextEncoder});

proj4.defs(
'EPSG:27700',
'+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
Expand Down
3 changes: 3 additions & 0 deletions worker.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import WebWorker from 'web-worker';

console.log(WebWorker);
Loading