terra-draw icon indicating copy to clipboard operation
terra-draw copied to clipboard

Feature Request: MapTalks Adapter

Open sakitam-fdd opened this issue 2 years ago • 2 comments

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.

sakitam-fdd avatar Aug 13 '23 16:08 sakitam-fdd

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 avatar Aug 15 '23 21:08 JamesLMilner

@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 

sakitam-fdd avatar Aug 16 '23 01:08 sakitam-fdd

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.

JamesLMilner avatar Mar 16 '25 13:03 JamesLMilner