Hi,

I forgot one thing. You also need a stylesheet
(../lib/widget/ShowDistance.xsl) with the following content:

<xsl:stylesheet version="1.0"
xmlns:mb="http://mapbuilder.sourceforge.net/mapbuilder";
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

  <xsl:output method="xml" omit-xml-declaration="yes" />

  <!-- The common params set for all widgets -->
  <xsl:param name="modelId" />
  <xsl:param name="widgetId" />
  <xsl:param name="action" />
  <xsl:param name="skinDir" select="/mb:MapbuilderConfig/mb:skinDir" />

  <!-- The title for the output -->
  <xsl:param name="distance">Distance:</xsl:param>

  <!-- The name of the form for distance output -->
  <xsl:param name="formName" />

  <!-- Main html -->
  <xsl:template match="/">
    <div>
      <form name="{$formName}" id="{$formName}">
        <xsl:value-of select="$distance" />
        <input name="distance" type="text" size="8" readonly="readonly" />
      </form>
    </div>
  </xsl:template>
</xsl:stylesheet>

And just in case you are wondering why you need that much
configuration for just one widget, here is a short explanation: when
you select the Measurement tool, the defaultModelUrl of the widget is
loaded into the measureTemplate model. Then the ShowDistance.xsl
stylesheet is applied to the model, which results in the HTML output
of the widget.

If you find it hard to build your own config based on my snippets
here, you can also have a look at the hidden "complete" example [1]
and its config [2].

Regards,
Andreas.

[1] http://demo.communitymapbuilder.org/demo/mapbuilder/demo/complete/index.html
[2] 
http://demo.communitymapbuilder.org/demo/mapbuilder/demo/complete/completeConfig.xml

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mapbuilder-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

Reply via email to