Select to view content in your preferred language

Integrated html popup window

2279
3
07-14-2011 03:34 PM
JeremyDavies
Regular Contributor
Hi- I would like to have an integrated popup html window come up when I click on a feature in ArcGIS Viewer for Flex. What I mean by 'integrated' (I'm sure there is a technical term for this) is a window that hovers over the map and displays by the content of another website, similar to the look of the default popup widget. As it is now, I can provide a link to the url that is in the default popup widget box , but the user clicks on the link which opens in a new window or tab, taking the user away from the map. In my case, the url I want to display in the window is a blog.

Has anyone out there developed such a widget? If not, do the experts out there think I need to do this via ArcGIS API for Flex?  Or is there a workaround that I a missing?

Thanks- any suggestions will be appreciated!

JD
Tags (2)
0 Kudos
3 Replies
dcopple
Frequent Contributor
I second that, was trying to do the same myself......
0 Kudos
AdamMessing
Emerging Contributor
There are standard HTML popups that come with ArcGIS (v.9.3.1 & 10). This one is "Green.xsl". All you need do is enter the target URL, or if you have the URL listed in the attribute table it will self populate. Just be sure to set the visible fields options so that they only see the link/webpage.

The only downside to this option is that it does not give you control over the size of the popup window with out some coding changes. But, you can always just grab a corner and resize manually.

Here you go:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<html>
<body>
<xsl:variable name="nameCol" select="FieldsDoc/Fields/Field/FieldName"/>
<table border="1" width="300" cellpadding="5" cellspacing="0">
<tr bgcolor="#1b8d3d">
<xsl:if test="string-length($nameCol) != 0">
<th width="50%" align="left">Field Name</th>
</xsl:if>
<th width="50%" align="left">Field Value</th>
</tr>
<xsl:variable name="index" select="1"/>
<xsl:for-each select="FieldsDoc/Fields/Field">
<tr>
<xsl:if test="(position() +1) mod 2">
<xsl:attribute name="bgcolor">#6fe392</xsl:attribute>
</xsl:if>
<xsl:if test="string-length($nameCol) != 0">
<td>
<xsl:value-of select="FieldName"/>
</td>
</xsl:if>
<td>
<xsl:choose>
<xsl:when test="FieldValue[starts-with(., 'www.')]">
<a target="_blank"><xsl:attribute name="href">http://<xsl:value-of select="FieldValue"/>
</xsl:attribute><xsl:value-of select="FieldValue"/>
</a>
</xsl:when>
<xsl:when test="FieldValue[starts-with(., 'http:')]">
<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="FieldValue"/>  </xsl:attribute><xsl:value-of select="FieldValue"/>
</a> 
</xsl:when>
<xsl:when test="FieldValue[starts-with(., 'https:')]">
<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="FieldValue"/>
</xsl:attribute><xsl:value-of select="FieldValue"/>
</a> 
</xsl:when>
<xsl:when test="FieldValue[starts-with(., '\\')]">
<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="FieldValue"/>
</xsl:attribute><xsl:value-of select="FieldValue"/>
</a> 
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="FieldValue"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</table>
<br/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
0 Kudos
jeffduncan
Emerging Contributor
hello,
does anyone know how to reuse the html popup window?  My users can use the html popup tool, click on a parcel polygon and some xsl code runs that calls some simple aspx code, that displays photos, a list of scans to display.. and in 1 popup window.   They repeat the click on another parcel and the information opens in a different window..

How do we make the code resuse 1 window, the intial window.

Here's my xsl code:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <xsl:variable name="nameCol" select="FieldsDoc/Fields/Field/FieldName"/>
  <xsl:template match="/">
    <html>
      <body bgcolor="black">
        <xsl:variable name="index" select="1"/>
        <xsl:for-each select="FieldsDoc/Fields/Field">
          <xsl:choose>
            <xsl:when test="FieldName[starts-with(., 'PIN')]">
              <xsl:variable name="pdfURL" select="FieldValue"/>
              <iframe src="http://inyogis1/ViewParcelObjects.aspx?PIN={$pdfURL}" width="500" height="100"></iframe>
              <iframe src="http://inyogis1/ViewParcelPhotos.aspx?PIN={$pdfURL}" width="500" height="600"></iframe>
            </xsl:when>
          </xsl:choose>
        </xsl:for-each>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
0 Kudos