AnsweredAssumed Answered

how to esri map display info window without clicking on the map or without click symbol

Question asked by sinharcgis on Sep 13, 2014

I'm using the esri map javascipts API. I want to show a infowindow(infowindown have zoomto) on the map. However, in the example given by esri, the user must need to click on the map or click sumbol to show the info window.. Can i just click on a button to show a info window or click dgrid row show in infowindow specific location? Thanks!.

 

when click button or click dgrid row call showResults(featureSet)

how to method showResults(featureSet) show infowindown(infowindown have zoomto) with out click symbol... Thanks!!

below showResults(featureSet). but this is not working as expected. Thanks!!

 

function showResults(featureSet) {

             

                  //remove all graphics on the maps graphics layer

                  myMap.graphics.clear();     

                  var resultFeatures = featureSet.features;

                  //Loop through each feature returned

                  for (var i = 0, il = resultFeatures.length; i < il; i++) {

                      //Get the current feature from the featureSet.

                      //Feature is a graphic

                      var attr = resultFeatures[i].attributes;

                      var title = attr.TEN;

                      var content = "Field ID : " + attr.OBJECTID

                    + "<br />Tên: " + attr.TEN

                    + "<br />Địa chỉ : " + attr.TEN

                      //initialize InfoTemplate

                      infoTemplate = new InfoTemplate("Kết quả tìm kiếm:", content);                

 

 

//                      myMap.infoWindow.setTitle(title);

//                      myMap.infoWindow.setContent(content);

//                      myMap.infoWindow.show(resultFeatures[0].geometry);

 

 

                     var graphic = resultFeatures[i];

                      graphic.setSymbol(symbol1);

 

 

                   //Set the infoTemplate.

                     graphic.setInfoTemplate(infoTemplate);

 

 

                      //                      //Add graphic to the map graphics layer.

                      //                      myMap.graphics.add(graphic);

                     myMap.graphics.add(graphic);

                      //                    

                      myMap.centerAndZoom(resultFeatures[0].geometry, 7);

                  }

              }

Outcomes