terra-draw
terra-draw copied to clipboard
Feature Request: MapTalks Adapter
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.
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!
@JamesLMilner
- 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
- 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
Now that we are at v1 it should be possible for users to create their own external adapters and maintain them. I'd welcome an external MapTalks adapter project, but will close this for now.