Class MVXMLStyle
MVXMLStyle lets you create a MapViewer style using the valid XML style
definition at the client side. You can create any MapViewer style using this method.
The XML style definition format is described in MapViewer User's Guide.
Typical useage of this class is illustrated below.
// create a marker style var xmlDef = '<svg width="1in" height="1in">'+ '<g class="marker" '+ 'style="width:19;height:19;stroke:0xff0000;fill:0x00ff00;stroke-width:1.5">'+ '<circle cx="0" cy="0" r="1"/>'+ '</g>'+ '</svg>' ; var style = new MVXMLStyle("my_style", xmlDef); themebasedfoi.addStyle(style); themebasedfoi.setRenderingStyle("my_style");
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 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.
Constructor Attributes | Constructor Name and Description |
---|---|
MVXMLStyle(name, xmlDef)
|
Class Detail
MVXMLStyle(name, xmlDef)
- Parameters:
- {string} name
- name of the style
- {string} xmlDef
- the XML definition of the style.