0

I would like to add a my popup work. I am confused which is which, infoWindow, popupTemplate and infoWindow. I have tried putting popupTemplate together but it does not load. The basemap works alright but does not load the load the layer.

require([
"esri/map",
"esri/layers/FeatureLayer",
"esri/dijit/Popup",
"esri/dijit/PopupTemplate",
"esri/dijit/InfoTemplate",//new addition for infoTemplate
"dojo/domReady!"
 ],
 function(Map, FeatureLayer, Popup, PopupTemplate, InfoTemplate) {
//create map
var map = new Map("map", {
  basemap: "hybrid",
  center: [-0.345, 5.543],
  zoom: 19
});
//info template defination
var infoTemplate = new InfoTemplate("${OBJECTID}", "${*}");
var featureLayer = new FeatureLayer({
  url: "http://192.168.1.2/ndigis/rest/services/map/GSMA/FeatureServer/3",
  outFields: ["*"],
  infoTemplate: infoTemplate
});

map.addLayer(featureLayer);


});

based on the implementation here https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=renderer_class_breaks.

  • 1
    why is url: set to server1url/rest when the comment has a local ip? Are you sure that isn't the problem? – jbchurchill Oct 5 '16 at 19:05
  • 1
    when you copy/paste the url of the featureLayer into a new browser tab, is it accessible? – john gravois Oct 5 '16 at 21:18
1

The module name for Info Template is :

"esri/InfoTemplate"

So change

"esri/dijit/InfoTemplate" to "esri/InfoTemplate"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.