Looking for guidance on saving user data in esriMapMarkerField

Certified Associate Developer

I am attempting to develop a feature for my application where a user can add a pin on a map using the esriMapMarkerField component. I've used it before with readOnly enabled, but not to gather user input. It seems like I'm supposed to add the relevant saves in the "onNewPointAdded" parameter, but the documentation is sparse on specific guidance with it. I would have assumed there would be some function variable to pass into the save, but I've come up with nothing. My code so far is below... does anyone have suggestions or an example they could provide?

a!localVariables(
  local!pointData: {},
  esriMapMarkerField(
    esriConnectedSystem: cons!MR_CS_ARC_GIS_MAP,
    baseMap: "oceans",
    secondaryMap: "satellite",
    zoomLevel: 3,
    mapCenter: { latitude: cons!MR_ESRI_MAP_CENTER_LATITUDE, longitude: cons!MR_ESRI_MAP_CENTER_LONGITUDE },
    isReadOnly: false,
    maxSelection: {point: 1, polyline: 0, polygon: 0},
    pointData: local!pointData,
    onNewPointAdded: a!save(local!pointData, )
  )
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    a!localVariables(
      local!onNewPointAdded,
      local!added,
      esriMapMarkerField(
      label: "ESRI Mark ",
      labelPosition: "ABOVE",
      validations: {},
      height: "TALL",
      esriConnectedSystem: cons!ESRI_CS,
      baseMap: "arcgis-navigation",
      secondaryMap: "arcgis-light-gray",
      zoomLevel: 5,
      onNewPointAdded: {
        local!onNewPointAdded,
        a!save(local!added,"New Point Added") /* You can save more info */
        }
    )
    )

    Use a rule input/local variable to store the new point added. To select a new point, click in "mark pin" and the click into the map. 

    Your local!onNewPointAdded should look like this:

    {{latitude: 49.23571891828543, longitude: 9.93170253199215, name: "Seibotenberg, 74582, Gerabronn, Seibotenberg, Baden-Württemberg", description: "", address: "Seibotenberg, 74582, Gerabronn, Seibotenberg, Baden-Württemberg", type: "Pin Type 1", color: "#4990e1"}}

  • 0
    Certified Associate Developer
    in reply to jesush905075

    Thank you for your help! I'm a bit confused about how this works without anything in the pointData parameter, but it looks like it should be fine for my purposes

Reply Children
No Data