-
Notifications
You must be signed in to change notification settings - Fork 50
Major refactoring, documenting and geoJSON viewing support #54
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
Conversation
Obsidian could not find the built main.js file in the dist folder
The old function name read like it would return the location of the front matter within the file. The new function name better describes what it does which is getting the coordinate from the front matter
Two more functions were a little ambiguous so renamed them to be less ambiguous Renamed location variable to coordinate
This class is capable of parsing more than just urls Also renamed some methods
Renamed a number of methods and added docstrings. parseCoordinateFromLine -> parseEditorLine parseCoordinateFromString -> parseString insertLocationToEditor -> editorInsertGeolocation convertUrlAtCursorToGeolocation -> editorLineToGeolocation
Split the yaml parsing and overwriting logic into a new function with a callback to do the modifying. This handles the yaml properly by parsing and then serialising it back. The previous implementation broke if the key exists only as a nested key. The value entry is now optional (defaulting to null) The value entry is now any arbitrary value which is then serialised to yaml. The only negative of this is that it populates null if no value is defined in the yaml
In order to implement multiple geographic data types (pins, polygons, polylines, ...) there needs to be a standard implementation that the map can use. This base class is that
Moved mapMarker to geoLayer Moved the marker init logic into the marker class so other geographic layer types can do the same. The BaseGeoLayer class defines the initGeoLayer which sets up the behaviour for that geographic type. It must populate the geoLayer field with a leaflet layer.
There may have been a reason for this but not that I can see
Settings can be found in the class attributes
The new name more concisely describes what the method does.
This better describes what the function does. Update implies extending but this will remove points if they are not in the added markers.
Renamed matchInlineLocation to matchInlineCoordinates to better describe what the function does. Rewritten regexes to use named capture groups to make them easier to maintain.
Added getBounds method so that it can work with points and shapes
pyCharm added this when I tried to type Array
This could probably be improved with better support for the other layer types.
|
First and foremost, thanks for doing this, it will be a great contribution to Map View!
A more comprehensive review will hopefully follow in the upcoming days :) |
|
The docstrings were populated mostly by PyCharm and I just filled them in. Edit2: It looks like the three line docstrings can be compacted onto a single line /**
* Docstring
*//** Docstring */ |
|
I would like to get this sorted. I have some more features that I would like to implement that will build upon these changes.
Edit: I would also like to implement a typescript formatter and validator so that there are not issues like in #16 |
|
It might be easiest if I split this into multiple pull requests since I am going to have to rewrite a lot of it anyway |
|
I'm really sorry for the holdup; not sure how it slipped my mind, and that's surely not how your great contributions deserve to get treated :( |
|
Thanks. I am looking into splitting this into multiple pull requests to make it easier to merge. |
|
I am part way into splitting this pull request into multiple pull requests. This should make it easier to review since each pull request will concentrate on a single component. Some components do depend on other things so I will need to wait until you have merged the previous ones to continue. As of currently: |
This is still work in progress but is mostly complete. I thought I would just open this so that you can see what I have been working on and give feedback.
This started out with the intention of adding geoJSON viewing support to the map plugin but has spiralled into more than that.
Adds support for the full geoJSON format within the front matter under the
geoJSONkey as well as within a code block of type geoJSONFixes #50
npm run devbuilds into the root directory so that the repository can be directly in the obsidian plugins directory.locationtocoordinateto disambiguate from file location.Won't Fix
GeoJSON Support
(and probably other things I have forgotten about)