SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A renderer to draw vector graphics like line, polygons, circles and so on a map.
The renderer is responsible to project the data (which is specified in map coordinates)
on the map and refresh the graphics after move and zoom events.
The map renderer is based on IWGraphicsRenderer and so browser independent (VML in Internet
Explorer 6-8, SVG otherwise).
Example:
var attributes = { fill: 'red', stroke: 'black', strokeDashStyle: 'dashed' };
var renderer = new IWMapRenderer(map);
renderer.drawCircle(map.getCenter(), 1000, attributes); // draw a 1 km circle in the center of the map
renderer.render();
Property | Description | Value | Elements |
---|---|---|---|
fill | the fill or text color | CSS color description, e.g. #ff0000 or blue | circle, ellipse, polygon, rectangle, rounded rectangle, text |
fillOpacity | the opacity of the fill color | value between 0 (transparent) 1 (opaque) | circle, ellipse, polygon, rectangle, rounded rectangle |
stroke | the stroke color | CSS color description, e.g. #ff0000 or blue | all |
strokeOpacity | the opacity of the stroke color | value between 0 (transparent) 1 (opaque) | all |
strokeWidth | the width of the stroke in pixels | number | all |
strokeDashStyle | the style of the stroke | solid, dashed, or dotted | all |
strokeLinejoin | the style of line joins | round, bevel, or miter | all |
strokeLinecap | the style of line ends | round, butt, or square | all |
fontFamily | the font family to render text | e.g. sans-serif or Helvetica | text |
fontStyle | the font style to render text | e.g. italic or normal | text |
fontSize | the font size to render text | e.g. 14px | text |
fontWeight | the font weight to render text | e.g. bold or normal | text |
textDecoration | the decoration to render text | e.g. underline, overline or line-through | text |
This class is part of the module graphics.
Constructor Summary | |
IWMapRenderer(map)
|
Method Summary | |
void
|
clearContainer()
Removes all DOM nodes from container. |
|
destroy()
undocumented |
|
drawCircle(center, radius, attributes)
Draws a circle with a specified center coordinate and radius in meters. |
|
drawComplexPolygon(coords, holes, attributes)
Draws a complex polygon defined by the specified coordinates and holes. |
|
drawEllipse(center, size, attributes)
Draws an ellipse with a specified center coordinate and with and height in meters. |
|
drawLine(point1, point2, attributes)
Draws a line between the specified coordinates. |
|
drawPolygon(coords, attributes)
Draws a polygon defined by the specified coordinates. |
|
drawPolyline(coords, attributes)
Draws a polyline connecting all specified coordinates. |
|
drawRectangle(center, size, attributes)
Draws a rectangle defined by it's center coordinate and size in meters. |
|
drawRoundedRectangle(center, radius, size, attributes)
Draws a rounded rectangle defined by it's center coordinate and size in meters. |
|
drawText(coord, text, attributes)
Draws a text on the map. |
object
|
getElement(position)
Get the element on the specific position |
|
moveBehind(otherRenderer)
undocumented |
|
moveToBack()
undocumented |
void
|
moveToBottom(element)
Moves the element to the bottom by setting it to the first child in the DOM-structure. |
|
moveToFront()
undocumented |
void
|
moveToTop(element)
Moves the element to the top by setting it the to last child in the DOM-structure. |
void
|
removeElement(element)
Removes a given DOM element from container |
void
|
render()
Renders the shapes on the map. |
void
|
shiftElement(element, position)
Moves an element to specific position |
Constructor Detail |
IWMapRenderer(map)
IWMap map
- the map
Method Detail |
void clearContainer()
void
destroy()
drawCircle(center, radius, attributes)
IWCoordinate center
- the center of the circle
Number radius
- the radius in meters
Object attributes
- the rendering attributes
drawComplexPolygon(coords, holes, attributes)
IWCoordinate[] coords
- the coordinates
IWCoordinate[][] holes
- an array of arrays of coordinates describing holes in the polygon
Object attributes
- the rendering attributes
drawEllipse(center, size, attributes)
IWCoordinate center
- center of the ellipse
IWSize size
- the size of the ellipse
Object attributes
- the rendering attributes
drawLine(point1, point2, attributes)
IWCoordinate point1
- first coordinate
IWCoordinate point2
- second coordinate
Object attributes
- the rendering attributes
drawPolygon(coords, attributes)
IWCoordinate[] coords
- the coordinates
Object attributes
- the rendering attributes
drawPolyline(coords, attributes)
IWCoordinate[] coords
- the coordinates
Object attributes
- the rendering attributes
drawRectangle(center, size, attributes)
IWCoordinate center
- center of the rectangle
IWSize size
- the size of the rectangle
Object attributes
- the rendering attributes
drawRoundedRectangle(center, radius, size, attributes)
IWCoordinate center
- center of the rectangle
Number radius
- the radius of the corners
IWSize size
- the size of the rectangle
Object attributes
- the rendering attributes
drawText(coord, text, attributes)
coord
- the coordinate to render the text at
text
- the text to render
Object attributes
- the rendering attributes
IWText
object getElement(position)
Number position
- position of the wanted element
object
the element, e.g. an instance of IWPolygon
moveBehind(otherRenderer)
otherRenderer
moveToBack()
void moveToBottom(element)
DOMElement element
void
moveToFront()
void moveToTop(element)
DOMElement element
void
void removeElement(element)
DOMElement element
void
void render()
void
void shiftElement(element, position)
Object element
- The vector object
Number position
- level position where the element shall be shifted to
positive values will shift the graphic on the top negative values will shift
the graphic on the bottom 'top' shift the graphic on the top 'bottom' shift
the graphic on the bottom '0' no changes on the drawing container
void