Skip to content

Commit

Permalink
refactor(cesium): Replace proj4 transformation with OL
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner authored and jmacura committed Jul 29, 2024
1 parent 49bbab6 commit f25075f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions projects/hslayers-cesium/src/hscesium-layers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
Vector as VectorSource,
XYZ,
} from 'ol/source';
import {default as proj4} from 'proj4';

import {HsConfig} from 'hslayers-ng/config';
import {HsEventBusService} from 'hslayers-ng/services/event-bus';
Expand All @@ -62,6 +61,7 @@ import {
import {HsCesiumConfig} from './hscesium-config.service';
import {OlCesiumObjectMapItem} from './ol-cesium-object-map-item.class';
import {ParamCacheMapItem} from './param-cache-map-item.class';
import {transform} from 'ol/proj';

function MyProxy({proxy, maxResolution, HsUtilsService, projection}) {
this.proxy = proxy;
Expand Down Expand Up @@ -376,7 +376,11 @@ export class HsCesiumLayersService {
const ya = coordinates[1];
const za = coordinates[2];

const newCoordinates = proj4(firstProjection, secondProjection, [xa, ya]);
const newCoordinates = transform(
[xa, ya],
firstProjection,
secondProjection,
);
return Cartesian3.fromDegrees(
newCoordinates[0],
newCoordinates[1],
Expand Down

0 comments on commit f25075f

Please sign in to comment.