= !InlineXhtml =
[[PageOutline]]
== Description ==
The !InlineXhtml Addin can be used for situations where server side
generation of, possibly interactive, layer tiles using (x)html is desired.
For example; server side generation of tiles using xhtml, html, canvas, svg, etc.
!InlineXhtml can be used for both native svg output from compatible WMS servers
and for adding scalable svg layers.
== Compatibility ==
|| Addin Version || OpenLayers Version ||
|| [http://svn.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk trunk] || > r? ||
* Added HTML5 support
1.0 [http://svn.openlayers.org/sandbox/hhudson/addins/InlineXhtml/release/1.0 InlineXhtml v1.0]
Note: See ticket [http://trac.openlayers.org/ticket/2415 #2415] for history
== Examples ==
''Suitable for browsers supporting xhtml and svg;''[[BR]]
* [http://dev.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/examples/example1.htm example1.htm] - An example using an svg layer and an xhtml layer.
* [http://dev.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/examples/example2.htm example2.htm] - An example of a scalable layer.
* [http://dev.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/examples/example3.htm example3.htm] - A non-interactive scalable layer.
* [http://dev.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/examples/example4.htm example4.htm] - A non-interactive scalable OSM Mapnik export.
* [http://dev.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/examples/example5.htm example5.htm] - A non-interactive WMS example.
* Simple Interactivity test case 1; [http://dev.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/examples/example6.htm xhtml] and [http://dev.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/examples/example7.htm html5].
== Installation and Use ==
1. Use subversion to check out the [http://svn.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/ InlineXhtml] addin.
1. Place the [http://svn.openlayers.org/sandbox/hhudson/addins/InlineXhtml/trunk/lib/OpenLayers/Tile/InlineXhtml.js Tile/InlineXhtml.js] file in your [source:trunk/openlayers/lib/OpenLayers/Tile/ Tile] directory (or alternatively, place it elsewhere and add a {{{
}}}
1. Use the [wiki:Profiles build tools] to create a single file build (or link to your !OpenLayers.js file to run in development mode).
1. Construct a map and add a WMS InlineXhtml layer with the following syntax:
{{{
var layer1 = new OpenLayers.Layer.WMS.InlineXhtml(
name,
url,
params,
options);
}}}
1. Construct a map and add an InlineXhtml layer with the following syntax:
{{{
var layer1 = new OpenLayers.Layer.InlineXhtml(
name,
url,
params,
options);
}}}
1. Construct a map and add a ScalableInlineXhtml layer with the following syntax:
{{{
var layer1 = new OpenLayers.Layer.ScalableInlineXhtml(
name,
url,
extent,
size,
options);
}}}
== Usage Notes ==
1. By default the inline content will be parsed as xhtml. Refer to the "isHtmlLayer" layer option for adding html layers.
1. Because !InlineXhtml makes use of XMLHttpRequest and imports the inline content directly into the document (as tile contents), it would probably necessitate the use of a proxy server (eg, proxy.cgi) to retrieve layers from remote servers.
== Tile.InlineXhtml ==
This tile class issues an Ajax request to retrieve inline content
to be imported into the document tile.
== Layer.WMS.InlineXhtml ==
This subclass to Layer.WMS can be used to add a WMS layer to the
map where the output of the WMS server is (x)html (eg, svg). For example;
{{{
var layer1 = new OpenLayers.Layer.WMS.InlineXhtml(
"Layer 1",
"http://",
{layers: 'abc', format: 'image/svg+xml'} );
}}}
== Layer.InlineXhtml ==
This layer class can be used to add a map layer where the
tile base url request parameters will be made up of; BBOX,
PROJECTION, WIDTH, HEIGHT and the server response is expected
to be (x)html.
=== Parameters ===
name - A name for the layer[[BR]]
url - Base url for the (x)html service[[BR]]
params - An object with key/value pairs that will be passed to the service[[BR]]
options - Hashtable of extra options to tag onto the layer[[BR]]
== Layer.ScalableInlineXhtml ==
This layer class is somewhat analogous to the Layer.Image class
but applies to inline (x)html. In addition to the url for the
scalable inline content (image), the layer extent also needs to be
specified. If an optional size (physical pixel dimensions) parameter
is supplied then the maximum resolution for the layer will automatically
be determined. In order for the layer to scale correctly when the map
zoom level is changed, the inline content should be natively scalable.
''Tip: If you are adding an svg image using Layer.ScalableInlineXhtml,
the outermost