/// <summary> /// This function shows how to populate stop locations using an array of PropertySets /// </summary> private void LoadLocations(NAServerSolverParams solverParams) { // Geocode Addresses PropertySet[] propSets = new PropertySet[2]; propSets[0] = GeocodeAddress(txtStartStreetAddress.Text, txtStartCity.Text, txtStartState.Text, txtStartZipCode.Text); propSets[1] = GeocodeAddress(txtEndStreetAddress.Text, txtEndCity.Text, txtEndState.Text, txtEndZipCode.Text); NAServerPropertySets StopsPropSets = new NAServerPropertySets(); StopsPropSets.PropertySets = propSets; NAServerRouteParams routeParams = solverParams as NAServerRouteParams; routeParams.Stops = StopsPropSets; }
/// <summary> /// This function shows how to populate stop locations using two different options: /// 1) From Record Set using a Point Feature Class - Uncommented /// 2) From an Array of PropertySets - Commented out /// Uncomment the option, you would like to use /// </summary> private void LoadLocations(NAServerSolverParams solverParams) { // Set first point PropertySet[] propSets = new PropertySet[2]; propSets[0] = CreateLocationPropertySet("Stop 1", "-122.49024904900", "37.74811940430", null); propSets[1] = CreateLocationPropertySet("Stop 2", "-122.43083365400", "37.75396354490", null); NAServerRouteParams routeParams = solverParams as NAServerRouteParams; NAServerPropertySets stopsPropSets = new NAServerPropertySets(); stopsPropSets.PropertySets = propSets; routeParams.Stops = stopsPropSets; }