Change popup feature menu heading - 4.28

301
4
Jump to solution
02-05-2024 09:28 AM
MatthewDriscoll
MVP Alum

*edit for more context

There seems to be a new item of heading in the search feature menu popup.   How do I change that from "Untitled" to something else or to get rid of it completely?

 

4.21 - Link Example - 4.21 

FeatureMenu421.jpg

4.28 - Link Example - 4.28 

FeatureMenu428.jpg

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JoelBennett
MVP Regular Contributor

The value of that heading should be the same as the title property for the layer containing the graphics.  If your layer doesn't have a title, that could explain it.  Or, if you're not using a layer and adding your graphics directly to the MapView's graphics collection instead, that might explain it as well.

View solution in original post

4 Replies
MatthewDriscoll
MVP Alum

Both examples given use the exact same code.  

function createPopupTemplate(){
      const urlTax = "https://ks1418.cichosting.com/ttp/tax/Search/search_tax_results.aspx?";
      const urlRC = "https://www.jfksgis.us/prc/"
      var parInfo = 'https://www.jfksgis.us/JFKSParcelSearch/parcelInformation.html';
      var platy = "Replace($feature.Plat_HL, ' ', '%20')"
      return{
        title:
          "<b>Owner:</b> {PartyName_1} " + 
          "<br /><b>Address: </b> {PropertyAddress}" +
          "<br><b>Property Number: </b> {PropertyNumber}" +
          "<br><b>Appraisal:</b> ${RP_AprTot}", 
        outFields: ["*"],
        content:
          [
            {
              type: "fields",
              fieldInfos:[
                {
                  fieldName: "QuickRefID",
                  label: "Quick Ref ID",
                },
                {
                  fieldName: "ACRES",
                  label: "Acres",
                  format:{
                    places: 2,
                  }
                },                
              ]
            },
            {
              type: "text",
              text: "<a class='hyperlinkURL' target='_blank' href=" + parInfo + "?PropertyID={PropertyID}&PID={PID}&PropNum={PropertyNumber}>Parcel Information</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a class='hyperlinkURL' target='_blank' href=" + urlTax + "PID={PID}>Tax Information</a>"
            },
            {
              type: "text",
              text: "<a class='hyperlinkURL2' target='_blank' href=https://{expression/platlinked}>View Plat</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a class='hyperlinkURL' href=" + urlRC + "{PropertyNumber}.pdf>Property Record Card</a>", 
            },          
          ],      
          expressionInfos:[
            {
              name: "platlinked",
              expression: platy, 
            },
          ],
          fieldInfos:[{
            fieldName: "RP_AprTot",
            label: "Total Appraised Value",
            format: {
              places: 2,
              digitSeparator: true,
            }         
          },
        ],
      }     
    };
0 Kudos
JoelBennett
MVP Regular Contributor

The value of that heading should be the same as the title property for the layer containing the graphics.  If your layer doesn't have a title, that could explain it.  Or, if you're not using a layer and adding your graphics directly to the MapView's graphics collection instead, that might explain it as well.

MatthewDriscoll
MVP Alum

The layer does have a title, see below.  I do add graphics directly, but the popup template is on the feature layer.  I will play around with it.   Is there a way to just not show the heading at all?

 

\

    const parcelLayer = new FeatureLayer({
      url: "https://www.jfksgis.us/server/rest/services/BaseLayers/JFKSBaseMapLayers/MapServer/3",
      title: "parcel Layer",
      popupTemplate : createPopupTemplate(),
      listMode: "hide",
      outFields:["*"]
    });
0 Kudos
MatthewDriscoll
MVP Alum

You were correct.  I used the graphics not the layer.  

https://codepen.io/mbdriscoll/pen/GReBgYd 

0 Kudos