Oracle Maps example - FOI theme with dynamically created Marker style


Instructions

This demo shows how to draw a customer theme-based FOI layer using dynamically generated Marker style. The new client side JavaScript class MVStyleMarker is used in this case to create a Marker style object which is then added to the associated theme-based FOI instance.

Source code

To create and use a vector Marker style (as shown in this demo):
    var style = new MVStyleMarker("my_vector_icon", "vector");
    style.setSize(19, 19);
    style.setStrokeColor("ff0000");
    style.setFillColor("00ff00");    
    style.setVectorShape("50,199,0,100,50,1,100,100,50,199");
    
        
    themebasedfoi.addStyle(style);
    themebasedfoi.setRenderingStyle("my_vector_icon");
In the above code the vector shape coordinates define a diamond symbol with green fill and red boundary.

To create and use a Marker style based on an image URL:

    var style = new MVStyleMarker("my_image_icon", "image");
    style.setSize(31, 10);
    style.setImageUrl("http://www.foo.com/bar.gif");

    themebasedfoi.addStyle(style);
    themebasedfoi.setRenderingStyle("my_image_icon");    
The above will fetch the image from the given URL and then use it as the marker icon when rendering the theme's features.