Select to view content in your preferred language

The Measurement Widget is not working alongside my other widgets

1408
13
Jump to solution
05-08-2023 07:55 AM
ChesouyeCoye
New Contributor III

I am creating a web application and I require the measurement widget, however it does not work alongside my other widgets. It does show up but it does not function and I am not able to see dots, initial points or lines. 

 

Please see application in codepen: 

https://codepen.io/chesouye/pen/ZEqrZwg

 
0 Kudos
13 Replies
ChesouyeCoye
New Contributor III

I have another concern. How do i remove the ArcGIS World Geocoding Service option from my feature search? 

0 Kudos
KenBuja
MVP Esteemed Contributor

Try setting sources to an empty array, then setting it separately

  var search = new Search({
    view: view,
    allPlaceholder: "Search",
    sources: []
  });

search.viewModel.sources = [{
        layer: parish,
        searchFields: ["PARISH_NAM"],
        displayField: "PARISH_NAM",
        exactMatch: false,
        outFields: ["OBJECTID", "PARISH_NAM"],
        name: "Parishes",
        placeholder: "example: Kingston"
      },
      {
        layer: ed,
        searchFields: ["ED_NAME"],
        displayField: "ED_NAME",
        exactMatch: false,
        outFields: ["ED_NO", "ED_NAME"],
        name: "Electoral Divisions",
        placeholder: "example: Kingston"
      },
      {
        layer: consti,
        searchFields: ["CONST_NAME"],
        displayField: "CONST_NAME",
        exactMatch: false,
        outFields: ["CONST_NO", "CONST_NAME"],
        name: "Constituency",
        placeholder: "example: Kingston Central"
      },
      {
        layer: ed_colored,
        searchFields: ["Name", "Party"],
        suggestionTemplate: "{Name}, Party: {Party}",
        exactMatch: false,
        outFields: ["*"],
        placeholder: "Anomalies",
        name: "Anomalies",
        zoomScale: 500000,
        resultSymbol: {
          type: "picture-marker", // autocasts as new PictureMarkerSymbol()
          url:
            "https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/live/images/senate.png",
          height: 36
        }
      }];

 

0 Kudos
ChesouyeCoye
New Contributor III

It still is showing the geocoding service. 

0 Kudos
KenBuja
MVP Esteemed Contributor

 I would suggest opening another question on this then.