AnsweredAssumed Answered

closest facility

Question asked by jay.kapalczynski on Dec 20, 2019
Latest reply on Dec 26, 2019 by jay.kapalczynski

I am looking at the example and having a hard time trying to figure out how to replace the hospital locations defined in the facilitiesOverlay, with features that I would have in a RestEndpoint.  Say my hospitals were in a RestEndPoint....

 

GraphicsOverlay {

        id: facilitiesOverlay

 

I think this would have to be manipulated as well?  

    function createFacilities() {
        featureLayerFishing.featureTable.forEach(function(graphic) {
        //featureLayerFishing.graphics.forEach(function(graphic) {
            var facility = ArcGISRuntimeEnvironment.createObject("Facility", {geometry: featureLayerFishing.geometry});
            facilities.push(facility);
        });
    }

 

I should be able to place the FeatureLayer in the map as such correct?

I tried to modify the createFacilities function above but did no justice as I am not sure how to approach this...

 

Any thoughts?

 

        Map {
            BasemapStreets {}

            initialViewpoint: ViewpointCenter {
                Point {
                    x: -13041154
                    y: 3858170
                    spatialReference: SpatialReference { wkid: 3857 }
                }
                targetScale: 1e5
            }
            FeatureLayer {
                id: featureLayerFishing

                ServiceFeatureTable {
                    id: featureTable0
                    url: "https://vvv.vvv.vvv.gov/arcgis/rest/services/Projects/vvv/FeatureServer/2"
               }
            }
            onLoadStatusChanged: {
                createFacilities();
                task.load();
            }
        }

 

Outcomes