obsidian-map-view icon indicating copy to clipboard operation
obsidian-map-view copied to clipboard

Add Geo Base Class

Open gentlegiantJGC opened this issue 3 years ago • 1 comments

Currently the FileMarker is the only geo map class that the project has. We want to implement the ability to display arbitrary geojson data and that data will not fit into the FileMarker class.

I suggest we add a base class which the FileMarker and geojson class derive from. The base class will define the minimum attributes for the rest of the system to work and the subclasses will extend them.

In my previous pull request I called it BaseGeoLayer which defined attributes for:

  1. The file the data came from
  2. other metadata from the file
  3. A leaflet layer object (typed in the subclass)
  4. An abstract constructor for the leaflet layer object.

The subclasses then define the implementation for the class. These were GeoJSONLayer and FileMarker.

The implementation for this can be seen here in my previous pull request. https://github.com/gentlegiantJGC/obsidian-map-view/blob/11477777418f2dd01b22893af4568e4c4b752b2a/src/markers.ts#L35-L258

Typing would then need to be changed to the base class.

If you are okay I will start working on it. I won't add the GeoJSON in this pull request, just the base class and the modified typing.

Which branch would you like me to work from?

Edit: Changed link

gentlegiantJGC avatar Jul 18 '22 09:07 gentlegiantJGC

I like the direction. Please base it on the v2.1 branch which includes a substantial set of changes.

esm7 avatar Jul 20 '22 09:07 esm7