tabris-plugin-maps
tabris-plugin-maps copied to clipboard
Drawing on the map
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)
});
These shapes make sense. The api looks reasonable but shouldn't that be strokeWidth?
@mpost Yes, that makes more sense.
Can you also provide .setMapStyle(), and more GoogleMapOptions like zoomGesturesEnabled, zoomControlsEnabled, tiltGesturesEnabled, scrollGesturesEnabled,rotateGesturesEnabled?
@fax1ty These options would be beneficial and we do accept pull requests. :)