!--a11y-->
Displaying Additional Cartographical
Information 
You can add additional cartographical information (relating to the display of backgrounds such as relief, rivers or cities, for example) to the Web item Map that you have already integrated into your Web application.
1.
You may need
to edit
shapefiles so as
to make them fit properly into the map background. This is described in the
How To-Paper „Create and Modify Arcview Maps” in the SAP Service
Marketplace, under the alias “bw”
® Services
& Implementation
® HOW TO…Guides
® Guide List
…BW 2.x.
2. Consider the following when wanting to display images as backgrounds:
As well as the Geo-TIFF image format, PNG, GIF, JPG, BMP, TIFF formats are also supported. These formats need a ‘world file’ (with a file ending that is dependent upon the file format: GIF ÞGFW, TIF ÞTFW,...) In each world file, image information is assigned geo-coordinates (degrees of latitude and longitude). With the Geo-TIFF image format, this information is found directly in the image file. Create this file with a text editor.
|
World file |
Notes |
|
0.0666666666666 0.0000000000000 0.0000000000000 -0.0666666666666 -140.00000000000000 90.00000000000000 |
1st line: Pixel size along X axis 2nd line: Rotation for the row 3rd line: Rotation for the column 4th line: Pixel size along Y axis 5th line: X coordinate of upper left-hand corner 6th line: Y coordinate of upper left-hand corner
The pixel size can be calculated as follows: The resolution of the image in height and width can be found in the properties of the image file using the calculation: (X coordinate right – X coordinate left) / width (Y coordinate below – Y coordinate above) / height |
The additional cartographical information is read from the AXL files and interpreted. In the following section, three sample files are described for different items of additional cartographical information.
Create the file usa_img.axl with a text editor (such as Notepad) or an XML editor. This sample file is used to create a relief background.
|
File: usa_img.axl |
Notes |
|
<?xml
version="1.0" encoding="UTF-8"?> |
Lines 1-4: The header is always the same Line 5: By changing the language attribute, you can either enter numbers in German (“de” ‘,’) or in English (“en”, ‘.’) format. . Lines 9/10: The image workspace describes the directory on the IGS in which the images are stored. Lines 12-17: Describes a layer of cartographical information. In this case, an image layer is being used (type=”image”). Each layer is given its own unique ID. Lines 13-14: The data is descried with in the dataset tag. Name contains the complete image file name; the corresponding directory is found via the workspace (see lines 9/10). Lines 15-16: You can create a transparency and a transparency color in the image properties. Lines 17-20: The XML tags must be re-closed. |
This example looks at a file with two background shapefiles (rivers represented with lines and lakes with polygons).
|
File: rivers.axl |
Notes |
|
<?xml version="1.0"
encoding="UTF-8"?> |
Line 1-7: See notes for first sample file. Line 9-11: A background shapefile is being used here. For this reason, the SHAPEWORKSPACE tag is required to specify the directory. Line 13-23: The first level is described (rivers). A shapefile layer is being used here. Line 14: Within the DATASET tag, the name of the shapefile (without file ending) can be found in the name attribute; the shapefile type is line. In this example, labels are also displayed next to rivers. A ‘group renderer’ that is made up of several simple renderers is used here. Line 15-22: GROUPRENDERER Line 16-18: SIMPLERENDERER for lines Line 17: The lines are described with SIMPLELINESYMBOL (width in pixels, color and line type). Line 19-21: SIMPLELABELRENDERER allows you to label the cartographical background; the attribute field contains the column from the respective .dbf file that is used for the label text. Lines 24-32: The second layer is described (lakes); this is also a shapefile level. Line 25: The shapefile type is polygon. The name of the shapefile appears as the name (without the file ending) Line 28: Lakes are displayed as non-transparent (fill transparency) blue (fill color) polygons with a blue (boundary color), non-transparent (boundary transparency) boundary, 2 pixels (boundary width) in size. |
This is the most complex sample definition. A total of four cartographical levels are defined. The layers are displayed partially scaling-dependently.
|
File: usa.axl |
Notes |
|
<?xml version="1.0" encoding="UTF-8"?> <ARCXML version="1.1"> <CONFIG> <ENVIRONMENT> <LOCALE country="US" language="en" variant="" /> </ENVIRONMENT> <MAP> <WORKSPACES>
<SHAPEWORKSPACE name="shp_ws-0" </WORKSPACES> <LAYER type="featureclass" name="DalSegno" visible="true" id="0" > <DATASET name="DalSegno" type="point" workspace="shp_ws-0" /> <SCALEDEPENDENTRENDERER upper="1:20000000"> <SIMPLERENDERER>
<RASTERMARKERSYMBOL image="C:\Program </SIMPLERENDERER> </SCALEDEPENDENTRENDERER> </LAYER> <LAYER type="featureclass" name="rivers" visible="true" id="1" > <DATASET name="usa_rivers" type="line" workspace="shp_ws-0" /> <SIMPLERENDERER> <SIMPLELINESYMBOL width="2" color="6,9,148" type="solid"/> </SIMPLERENDERER> </LAYER> <LAYER type="featureclass" name="cities" visible="true" id="2" > <DATASET name="USA_Cities" type="point" workspace="shp_ws-0" /> <GROUPRENDERER> <VALUEMAPRENDERER lookupfield="CAPITAL">
<EXACT value="Y"> </EXACT> <EXACT value="N">
<SIMPLEMARKERSYMBOL type="triangle" color="0,0,0" </EXACT> </VALUEMAPRENDERER> <SCALEDEPENDENTRENDERER upper="1:20000000"> <SIMPLELABELRENDERER field="NAME"> <TEXTSYMBOL fontcolor="0,0,0" font="Courier"/> </SIMPLELABELRENDERER> </SCALEDEPENDENTRENDERER> </GROUPRENDERER> </LAYER> <LAYER type="featureclass" name="lakes" visible="true" id="3" > <DATASET name="usa_lakes" type="polygon" workspace="shp_ws-0" /> <SIMPLERENDERER>
<SIMPLEPOLYGONSYMBOL
filltransparency="1" </SIMPLERENDERER> </LAYER> </MAP> </CONFIG> </ARCXML> |
Lines 1-12: See corresponding line notes for the second example. Lines 13-21: The company location is displayed using a shapefile with a single point (company location). This point is displayed as an image (RASTERMARKERSYMBOL). The image is accessed via the attribute image (complete path on the IGS plus file name). The tag SCALEDEPENDENTRENDERER is used here so that the image only appears as of map resolution of 1:20 000 000. The attribute upper is used to determine the from boundary for the scaling. Lines 41-46: Layer definition for rivers (shapefile). Lines 48-67: Layer definition for the cities (shapefile). The capital is to be displayed as a larger circle, other cities as triangles. The tag VALUEMAPRENDERER is used to do this. This tag allows you to render the map independently of values from the .dbf attribute file. The field is selected from the .dbf file using the attribute lookupfield. You can use the tag EXACT to select individual values and specify the corresponding RENDERER. In this case, entering CAPITAL and Y renders a point with type triangle. The tag SCALEDEPENDENTRENDERER is used to make sure the label does not appear until a scaling of 1:20 000 000. Lines 68-75: Level definition for the lakes Line 76-78: Open XML tags are closed. |
...
Save the AXL files to the Shapefile directory on the IGS. You can find this under Internet Graphics Server\data\shapefiles.

Note that you also need to save the referenced shapefiles and images (including the corresponding image world files, if necessary) in the directory you specified using the WORKSPACE entry.
...
1. Start the Web Application Designer and create a Web template in which you want to drag the Web item Map. Alternatively, load a Web template to which you want to add additional cartographical information.
2. Enter the name of the AXL file in the properties of the Web item Map for the attribute CART_AXL_NAME (AXL File (Cartography)). This attribute specifies which AXL file is displayed initially.
3. Select the attribute CART_AXL_VISIBLE (Cartographical information on/off) in the properties of the Web item Map. This attribute specifies whether cartographical information is to be displayed or not.
4. Activate the attribute GEO_FUNCTIONS_ADVANCED (Enhanced Geo-Function Bar) in the properties of the Web Item Map for the scaling-dependent map information.
5. In the Web Application Designer, switch to the HTML view.
6. In this example, you can select cartographical information using radio buttons. Radio buttons allow you to switch between several AXL files or to deactivate the cartographical information.
|
Web template |
Notes |
|
<form name= "map_form" > <table class= "SAPBEXstdData" > <tr> <td align= "left" nowrap class= "SAPBEXTxtLbl" > <input type= "radio" name= "axl_radio" value= "NONE" onclick= "hide_axl()" class= "SAPBEXRb" >Without cartography </td> <td align= "left" nowrap class= "SAPBEXTxtLbl" > <input type= "radio" name= "axl_radio" value= "rivers.axl" onclick= "axl(this.value)" class= "SAPBEXRb" >Rivers and lakes<br> </td> </tr> <tr> <td align= "left" nowrap class= "SAPBEXTxtLbl" > <input type= "radio" name= "axl_radio" value= "usa_img.axl" onclick= "axl(this.value)" class= "SAPBEXRb" >Relief </td> <td align= "left" nowrap class= "SAPBEXTxtLbl" > <input type= "radio" name= "axl_radio" value= "usa.axl" onclick= "axl(this.value)" class= "SAPBEXRb" >Rivers, lakes and cities<br> </td> </tr> </table> </form> |
When a user selects one of the radio buttons, the system executes the JavaScript function axl or hide_axl.
|
7. Insert the JavaScript function- either axl or hide_axl -described under point 6 into the HTML header of your Web template.
|
Web template |
Notes |
|
<HTML> <HEAD> … <script type= "text/javascript" > <!-- function hide_axl() { location.href=" <SAP_BW_URL> " + "&item= Karte1 &cart_axl_visible="; } function axl(axl_name) { location.href=" <SAP_BW_URL> " + "&item= Karte1 &cart_axl_visible=X&cart_axl_name=" + axl_name;
}
|
If your Web item Map has another name, replace the name of the parameter item=map1 with the name of your map. |
8. You also need to insert the following JavaScript function in the script area of the header. This ensures that the correct radio button is still selected after one of these functions is used.
|
Web template |
Notes |
|
function check_radio() { prop = SAPBWGetItemProp(" Karte1 "); var shown = false; var axl_name; if (prop != null){ for(k=0;k<prop.length;k++){ if (prop[k][0] == "CART_AXL_VISIBLE") shown = (prop[k][1] == "X"); if (prop[k][0] == "CART_AXL_NAME") axl_name = prop[k][1]; } } if (shown) { for(k=0;k<document.karten_form.axl_radio.length;k++) { if (document.karten_form.axl_radio[k] .value==axl_name) document.karten_form.axl_radio[k] .checked=true; } } else { document.karten_form.axl_radio[0] .checked=true; } }
|
This JavaScript function checks the attributes CART_AXL_VISIBLE (Cartographical Information On/Off) and CART_AXL_NAME (AXL file (Cartography)) for the map and sets the radio button correspondingly. Set the name of your Web item in the function SAPBWGetItemProp.
|
9. Do not call up the function above in your Web template until right at the end.
|
Web template |
Notes |
|
… <script type="text/javascript"> <!-- check_radio(); --> </script> </BODY> </HTML>
|
|
You have enhanced the map in your Web application with additional cartographical information, such as cities, rivers or lakes.

· Transparency is always specified as a value between 0 and 1. 1 means no transparency and 0 means 100% transparency. If you want to set a color in a background image (level image or RASTERMARKERSYMBOL) to transparent, set the color to the RGB value 255,0,255.
· Color values are given as RGB values in the form R,G,B (for example, 128,128,128).
· The image formats supported by IGS are: Geo-TIFF, PNG, GIF, JPG, BMP, TIFF.