Class Index

Global Variables

Classes


Class MVStyleMarker

MVStyleMarker lets you create a MapViewer MARKER style instance at the client side. You can specify the essential information when creating a new Marker style, such as the style name and marker type (image or vector based). You can set other aspects through various setter methods, such as the vector shape and fill and stroke colors as well as their opacity for a vector type Marker, or the image URL for an image based Marker style.
Note that for vector type, only basic shapes such as circles, rectangles and simple polygons/polylines are supported. These vector shapes must be able to be drawn in one continuous pen stroke. In other words, you cannot have a polygon Marker with a hole inside it (to draw the hole you must lift your pen and start on a different stroke).
Typical useage of this class is illustrated below.

      var style = new MVStyleMarker("my_vector_icon", "vector");
      style.setSize(19, 19);
      style.setStrokeColor("ff0000");
      style.setStrokeWidth("1.5");
      style.setFillColor("00ff00");

      //this sets the shape to be a circle with a dummy radius value (50).
      //the actual size of the circle when displayed is specified in the
      //style.setSize() call above.
      style.setVectorShape("c:50");

      //this is how you set up a simple polygon instead of circle:
      //style.setVectorShape("50,199,0,100,50,1,100,100,50,199");
      
      themebasedfoi.addStyle(style);
      themebasedfoi.setRenderingStyle("my_vector_icon");

   

Note that once a style object is added to the theme based FOI instance and set as its rendering style, the MapViewer server side will typically cache and reuse a renderered version of the marker style for all subsequent theme-based FOI requests that uses a style with the same name and size. As such, when you modify a style client-side, you should also modify its name (and/or size) in order to display the modified version on the map. If you do modify the style's name, don't forget to change it in the themebasedfoi.setRenderingStyle() call too.

Class Summary
Constructor Attributes Constructor Name and Description
 
MVStyleMarker(name, type)
Method Summary
Method Attributes Method Name and Description
 
Sets the description of this COLOR style.
 
setFillColor(fill, op)
Sets the fill color and (optionally) its opacity.
 
setImageUrl(imgUrl)
Sets the URL of the image to be used for this marker style.
 
setName(name)
Sets the name of this Marker style.
 
setSize(width, height)
Sets the preferred width and height (in pixel) of this marker style as displayed on screen.
 
setStrokeColor(stroke, op)
Sets the stroke color and (optionally) its opacity.
 
Sets the pen width when drawing the shape (boundary).
 
Sets the shape coordinates for the vector type marker.
Class Detail
MVStyleMarker(name, type)
Parameters:
{string} name
name of the MARKER style
{string} type
specifies the type of the MARKER: must be "image" or "vector".
Method Detail
setDescription(desc)
Sets the description of this COLOR style.
Parameters:
{string} desc
a short description of the style

setFillColor(fill, op)
Sets the fill color and (optionally) its opacity. Fill color is used to fill the interior of the shape of a vector type marker style.
Parameters:
{String} fill
the fill color specified in the format of "RRGGBB".
{int} op
the opacity value for the fill color ([0 - 255]).

setImageUrl(imgUrl)
Sets the URL of the image to be used for this marker style.
Parameters:
{string} imgUrl
the url to an image file.

setName(name)
Sets the name of this Marker style.
Parameters:
name

setSize(width, height)
Sets the preferred width and height (in pixel) of this marker style as displayed on screen. MapViewer server will automatically scale the image or vector marker acoordingly based on these values. Default values (when not specified) are 16 by 16 pixels.
Parameters:
width
height

setStrokeColor(stroke, op)
Sets the stroke color and (optionally) its opacity. Only used by vector type markers. Opacity value ranges from 0 (completely transparent) to 255 (completely opaque). Default value is 255.
Parameters:
{String} stroke
the stroke color (for drawing the boundaries of vector shape) specified in the format of "RRGGBB";
{int} op
the opacity value for the stroke color ([0 - 255]).

setStrokeWidth(sw)
Sets the pen width when drawing the shape (boundary). Default is 1.
Parameters:
{float} sw
stroke width in device point/pixel unit

setVectorShape(vector)
Sets the shape coordinates for the vector type marker. It basically supports two types of shapes: polygon/polyline and circle. For polygon/polyline (which can be used to represent rectangle, triangle and other simple shapes), the parameter must be a series of comma separated ordinates (x1,y1,x2,y2,...). Note that for polygon/polyline shapes, the cooridnates can be in any coordinate system with arbitrary origin. MapViewer will do all the necessary transformation at the server side. For instance, the following cooridnates represent a diamond shape: "50,199,0,100,50,1,100,100,50,199" For circle type marker, the parameter must start with "c:" and followed by a single numeric value representing the radius of the cirlce, such as "c:50".
Parameters:
{String} vector
a string representing the vector shape

Documentation generated by JsDoc Toolkit 2.1.0 on Fri Feb 25 2011 12:34:46 GMT-0500 (EST)