Skip to content

Commit

Permalink
refactor: remove init
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasNorin committed Feb 18, 2025
1 parent 0330461 commit cced1b7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 38 deletions.
9 changes: 1 addition & 8 deletions js/map.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Map as LeafletMap } from 'leaflet';
import CreateMap from "./setupMap/createMap";
import MapInitializer from "./setupMap/mapInitializer";
import SetupTiles from "./setupMap/setupTiles";
import { ConfigInterface } from './setupMap/config/configInterface';
import { ConfigOptions, PartialConfigOptions } from './types';
import { MapInterface } from './mapInterface';
import { Config } from './setupMap/config/config';
Expand All @@ -12,12 +10,7 @@ class Map implements MapInterface {

constructor(private options: ConfigOptions) {
this.map = new CreateMap(this.options).create();

new MapInitializer(
this.options,
this.map,
new SetupTiles(this.map, this.options)
).initialize();
new SetupTiles(this.map, this.options).set();
}

public getMap(): LeafletMap {
Expand Down
4 changes: 3 additions & 1 deletion js/setupMap/createMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class CreateMap implements CreateMapInterface {
{
scrollWheelZoom: this.options.scrollWheelZoom,
keyboard: this.options.keyboard,
attributionControl: false
attributionControl: false,
center: this.options.center,
zoom: this.options.zoom,
}
);
}
Expand Down
26 changes: 0 additions & 26 deletions js/setupMap/mapInitializer.ts

This file was deleted.

3 changes: 0 additions & 3 deletions js/setupMap/mapInitializerInterface.ts

This file was deleted.

0 comments on commit cced1b7

Please sign in to comment.