PopupMobile title and content

3158
0
07-11-2014 12:30 PM
CollinGrove1
New Contributor

I'm trying to implement a PopupMobile for my map. After following a couple tutorials, I can get the popup to show, but am not able to set the title or content.

I set the popup early: "var popup = new PopupMobile(null, domConstruct.create("div"));", and also set "infoWindow: popup" for the map.

Here's the block of code that's giving me a hard time:

map.on("click", function(event) {

       var query = new Query();

       query.geometry = pointToExtent(map, event.mapPoint, 10);

       var deferred = layerAISF.selectFeatures(query, FeatureLayer.SELECTION_NEW);

       map.infoWindow.setFeatures([deferred]);

       map.infoWindow.setTitle("${name}");

      map.infoWindow.setContent("<b>This is the content of the popup</b>");

       map.infoWindow.show(event.mapPoint);

});

The problem I'm having is trying to interpret the following note that applies to PopupMobile.setFeatures(features):

"Note:When setFeatures is used the title area displays the number of features and the index of the currently selected feature and ignores the title defined in the info template. If you want to display title text you will need to specify it as part of the info window content."

How do I specify the title text as part of the info window content?

Screen Shot 2014-07-11 at 3.26.55 PM.png

0 Kudos
0 Replies