2-4 Oracle Fusion Middleware Users Guide for Oracle MapViewer
states on a map showing all or a large part of a country; however, it would not be useful for a display zoomed in on a specific city and its local surrounding area.
Example 2–1 Scalable Marker Style
style name=M.STAR_CAPITAL_CITY svg width=1in height=1in
desc g class=marker
style=stroke:000000;fill:FF0000;fill-opacity:0;width:15.0km;height:15.0km;font- family:Dialog;font-size:12;font-fill:FF0000
polyline points=138.0,123.0,161.0,198.0,100.0,152.0,38.0,198.0,61.0,123.0,0.0,76.0,76.0,76
.0,100.0,0.0,123.0,76.0,199.0,76.0 g
svg style
Example 2–2 defines a line style with an overall line width of 10 meters 10.0m and a
border line width of 1 meter 1.0m. This definition might be useful for identifying capital cities of primary highways.
Example 2–2 Scalable Line Style
style name=L.PRIMARY_HIGHWAY svg width=1in height=1in
descdesc g class=line cased=true style=fill:33a9ff;stroke-width:10.0m
line class=parallel style=fill:aa55cc;stroke-width:1.0m g
svg style
When MapViewer renders or labels styles that have size units other than pixel, it first transforms the size units into screen pixels based on the current map area and display
area, and it then renders the or labels the style. The size of a scalable style changes as users zoom in or out on a map. If zooming out results in an overall style size less than
or equal to zero, the style is not rendered or labeled.
Size units can be used only with data associated with a known spatial reference system SRS. If the data has no SRS or an unknown SRS, pixels are used for all size values.
Note also that pixel values are used instead of any specified size unit in legends and in previews rendered by the Map Builder utility. Legends are explained in
Section 2.4.2 .
Scalable styles work with MapViewer Release 11g 11.1.1 or later; they cannot be used with earlier releases of MapViewer.
2.2.2 Specifying a Label Style for a Bucket
For collection-based bucket styles and individual range-based bucket styles described in
Section A.6.1.1 and
Section A.6.1.2 , respectively, you can specify a labeling style by
using the label_style attribute in each bucket element. Example 2–3
creates an advanced style named V.RB1 in which each bucket is assigned a text label style using
the label_style attribute, with some styles being used for several buckets.
Example 2–3 Advanced Style with Text Label Style for Each Bucket
?xml version=1.0 ? AdvancedStyle
BucketStyle
MapViewer Concepts 2-5
Buckets RangedBucket seq=0 label=10k or less high=10000
style=c.rb13_1 label_style=T.AIRPORT NAME RangedBucket seq=1 label=10k - 20k low=10000 high=20000
style=c.rb13_2 label_style=T.CITY NAME RangedBucket seq=2 label=20k - 30k low=20000 high=30000
style=c.rb13_3 label_style=T.CITY NAME RangedBucket seq=4 label=30k - 40k low=30000 high=40000
style=c.rb13_4 label_style=T.CITY NAME RangedBucket seq=5 label=40k - 50k low=40000 high=50000
style=c.rb13_5 label_style=T.CITY NAME RangedBucket seq=6 label=50k - 75k low=50000 high=75000
style=c.rb13_6 label_style=T.ROAD NAME RangedBucket seq=7 label=75k - 100k low=75000 high=100000
style=c.rb13_7 label_style=T.PARK NAME RangedBucket seq=8 label=100k - 125k low=100000 high=125000
style=c.rb13_8 label_style=T.RED STREET RangedBucket seq=9 label=125k - 250k low=125000 high=250000
style=c.rb13_9 label_style=T.ROAD NAME RangedBucket seq=10 label=250k - 450k low=250000 high=450000
style=c.rb13_10 label_style=T.ROAD NAME RangedBucket seq=11 label=450k - 650k low=450000 high=650000
style=c.rb13_11 label_style=T.ROAD NAME RangedBucket seq=12 label=650k up low=650000 style=c.rb13_13
Buckets BucketStyle
AdvancedStyle
For individual range-based buckets, the lower-bound value is inclusive, while the upper-bound value is exclusive except for the range that has values greater than any
value in the other ranges; its upper-bound value is inclusive. No range is allowed to have a range of values that overlaps values in other ranges.
If the V.RB1 style in Example 2–3
is used in a map request, it displays a map that might look like the display in
Figure 2–1 , where the county names are shown with
labels that reflect various text styles in this case depending on the county’s total population.
Figure 2–1 Varying Label Styles for Different Buckets
In Example 2–3
, all buckets except the last one specify a label style. For any features that fall into a bucket that has no specified label style, the label style if any applied to
the feature depends on the following:
2-6 Oracle Fusion Middleware Users Guide for Oracle MapViewer
■
If the label element of the theme’s styling rules specifies a label style other than the advanced style itself, the specified label style is used to label the feature.
In the following example, because the label element’s style specification T.STATE_NAME is different from the features element’s style specification
V.RB1, features that fall into a bucket with no specified label style are labeled using the T.STATE_NAME style:
?xml version=1.0 standalone=yes? styling_rules
rule column=TOTPOP features style=V.RB1
features label column=county style=T.STATE NAME
1 label
rule styling_rules
■
If the label element of the theme’s styling rules specifies the advanced style as its label style, the feature is not labeled. This is why some counties in
Figure 2–1 are not labeled. In the following example, because the features and
label elements both specify the advanced style V.RB1, features that fall into a bucket with no specified label style are not labeled:
?xml version=1.0 standalone=yes? styling_rules
rule column=TOTPOP features style=V.RB1
features label column=county style=V.RB1
1 label
rule styling_rules
2.2.3 Orienting Text Labels and Markers