JamesLMilner / terra-draw

A library for drawing on maps that supports Mapbox, MapLibre, Google Maps, OpenLayers and Leaflet out the box
https://terradraw.io
MIT License
448 stars 51 forks source link

Feature Request: MapTalks Adapter #71

Open sakitam-fdd opened 1 year ago

sakitam-fdd commented 1 year ago

maptalks is a light JavaScript library to create integrated 2D/3D maps. Although it has a set of built-in drawing tools, some functions may be missing, so it is a good solution to adapt its terra-draw to maptalks.

JamesLMilner commented 1 year ago

Hey, thanks for the interest in Terra Draw and raising this ticket! I had not actually come across maptalks before (looks cool!) so would need to do a bit of research to understand how it works and if it would be a good fit for an adapter. I'm also keen to understand the size of the community demand for such an adapter first. There is a potential it may be better suited as a 3rd party package (luckily Terra Draw is designed to be extensible so this should be very possible!).

Let me have a think and a look over your PR to get a better understanding of how it works and how it might fit in. Again, thank you for raising the issue and the PR - always happy to have people sharing ideas!

sakitam-fdd commented 1 year ago

@JamesLMilner

  1. Regarding community needs: Currently, maptalks has an internal drawing tool and an external tool library maptalks-plot, but the scalability is not very good. For example, there may be no related better implementations for commonly used adsorption tools and shortcut keys. So based on terra-draw, a highly unified drawing plug-in can be realized, and it can be compatible with the webgl layer of maptalks, which is very cool
  2. Regarding the implementation of the plug-in, in fact, I may not recommend the method of concentrating on the core library. A better way is (maybe just a personal idea) to use monorepo (pnpm + workspace) to manage the core library. Independent of the adapter, the basic directory is as follows:
├── packages          # source
 │   ├── core              # terra-draw core
 │   ├── openlayers   # openlayers adapter 
 │   ├── mapbox-gl   # mapbox-gl adapter 
 │   ├── ...                  # other adapter