type | Object ( geomap style ) |
---|---|
default | { borderRadius: "8px", color: "#7f0000", fill: undefined, fillOpacity: .2, height: "8px", opacity: 1, stroke: undefined, strokeOpacity: 1, strokeWidth: "2px", visibility: "visible", width: "8px" } |
init | $( map selector ).geomap( { drawStyle: { color: "green" } } ); |
get | var drawStyle = $( map selector ).geomap( "option", "drawStyle" ); |
set | $( map selector ).geomap( "option", "drawStyle", { strokeWidth: "4px" } ); |
The drawStyle option retrieves or updates the style of incomplete lines and polygons as they are being drawn. This differs from the shapeStyle option which updates the base style of shapes that you append to the map.
Two extra color properties, stroke and fill, are not defined by default and use the value of the color property until they are defined individually.
This option affects both the draw modes (drawPoint, drawLineString, and drawPolygon) and the measure modes (measureLength, and measureArea).
This option changes specific properties of the internal style object. If you init or set an incomplete style object, only the style properties you reference are updated.
var map = $( '#map' ).geomap( ); map.geomap( 'option', 'shapeStyle' ); // { // color: "#7f0000" // ... // strokeWidth: "2px" // }
$( '#map' ).geomap( 'option', 'drawStyle', { stroke: '#00f' } );
Please see the style section at the bottom of the geomap widget page for more information about the style object.