tabris-plugin-maps icon indicating copy to clipboard operation
tabris-plugin-maps copied to clipboard

Drawing on the map

Open cookieguru opened this issue 9 years ago • 4 comments

It would be great to have an API to draw on the map. For starters I can envision three shapes:

  • [ ] Lines. A constructor could look like:
new Line({
  points: [ [lat, lon], [lat, lon], ... ],
  strokeColor: "blue",
  strokeWeight: 2
});

Similar to the other Tabris.js APIs the various color paramaters could take a Color which would eliminate the need for a separate key to specify opacity

  • [ ] Polygons. Similar to Line but with optional stroke color and fill. There would probably be an implied connection between the first and last points if they differ. A constructor could look like:
new Polygon({
  points: [ [lat, lon], [lat, lon] ],
  strokeColor: "blue",
  strokeWeight: 2,
  fillColor: rgba(50, 50, 255, 0.5)
});
  • [ ] Circles. A centerpoint and a radius A constructor could look like:
new Circle({
  center: [lat, lon],
  strokeColor: "blue",
  strokeWeight: 2,
  fillColor: rgba(50, 50, 255, 0.5)
});

cookieguru avatar Sep 03 '16 06:09 cookieguru

These shapes make sense. The api looks reasonable but shouldn't that be strokeWidth?

mpost avatar Sep 05 '16 09:09 mpost

@mpost Yes, that makes more sense.

cookieguru avatar Sep 05 '16 14:09 cookieguru

Can you also provide .setMapStyle(), and more GoogleMapOptions like zoomGesturesEnabled, zoomControlsEnabled, tiltGesturesEnabled, scrollGesturesEnabled,rotateGesturesEnabled?

fax1ty avatar Jun 11 '19 14:06 fax1ty

@fax1ty These options would be beneficial and we do accept pull requests. :)

mpost avatar Jun 11 '19 15:06 mpost