<< Click to Display Table of Contents >>

 

new sg.InfoTemplate(title, content)

 

 

Description

Create an InfoTemplate object.

 

Position

InfoWindow.js

 

 

Parameters

 

Parameter

Type

Description

title

String

Window title

content

String

The info content

 

 

Methods

 

Methods

Type

Description

setContent(content)

String

Define the info content.

Name

Type

Description

content

String

The content of info window

setTitle(title)

String

When an object is set as map's info window, this method will be called by the map.

Name

Type

Description

content

String

The title of info window

 

 

Example

 

 

<script type="text/javascript" src="scripts/FeatureLayer.js"></script>

<script type="text/javascript" src="scripts/Infowindow.js"></script>

 

//Define InfoTemplate

var infoTemp = new sg.InfoTemplate("${admin}", "${*}");

 

//Create a FeatureLayer using the Infotemplate to show attributes in a popup window.

var featureLayer = new sg.FeatureLayer('agent.aspx', {

               name: 'Countries',

               mode: sg.FeatureLayer.MODE_ONDEMAND

           });

featureLayer.setInfoTemplate(infoTemp);

 

 

 


©2015 Supergeo Technologies Inc.