Add a resource

The format of the <method> element for adding a resource is:

<method methodName="resource.addResource">

Use this method to add a resource to the system. The <method> element contains one or more <resources> elements each of which defines a map to add the resource to. The <resources> element contains one or more <resource> elements each of which identifies a resource.

<resources>

The <resources> element defines a set of resources for a map and has the following attribute:

Table 1. Attributes of the <resources> element
Attribute name Required or optional Description

mapName

Required

The name of a map to add the resource to.

Value: String

Default value: None

<resource>

The <resource> element is a child element of <resources>. The element defines a resource for a map and has the following attribute:

Table 2. Attributes of the <resource> element
Attribute name Required or optional Description

name

Required

The name of the resource to add to the map.

Value: String

Default value: None

Example

This example adds an image named ny.gif to a map named map1.

<methodCall>
	<method methodName="resource.addResource">
		<resources mapName="map1">
			<resource name="ny.gif" />
		</resources>
	</method>
</methodCall>