BBaysinger
BBaysinger

Reputation: 6877

Custom drawing layer in Mapbox GL JS (and Leaflet)

I'm starting research to add a user feature to an existing map built in Mapbox GL JS (wrapped in an Angular 2+ application). What I need to do, is allow a user to be able to draw and rotate ellipses and text labels over the top of a map, and be able to save screen captures of the result.

I'm coming into this with no experience in Mapbox or Leaflet, so I have a lot to figure out. My first goal is to determine if I can do this in Mapbox directly (with a plugin?), of if I will need to render a canvas over the top of my map with some third-part drawing library (I have a lot of experience with those).

The obvious advantage to doing this in Mapbox directly would be that we might still be able zoom and pan.

Upvotes: 1

Views: 2364

Answers (1)

Steve Bennett
Steve Bennett

Reputation: 126887

The Mapbox-gl-draw library lets the user author features in a map, but probably not to the extent you need.

If the features the user creates don't need to live "in map space" (ie, the map is static, and the labels are statically positioned over the top, for printing), working directly on a canvas will give you much more flexibility. You'll also have access to a much wider variety of libraries.

Upvotes: 2

Related Questions