public IEnumerator LanguageGerman() { MapMatchingResource resource = new MapMatchingResource(); resource.Coordinates = new Vector2d[] { new Vector2d(48.1974721043879,16.36202484369278), new Vector2d(48.197922645046546,16.36285901069641) }; //set Steps to true to get turn-by-turn-instructions resource.Steps = true; resource.Language = InstructionLanguages.German; MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); MapMatchingResponse matchingResponse = null; mapMatcher.Match( resource, (MapMatchingResponse response) => { matchingResponse = response; } ); IEnumerator enumerator = _fs.WaitForAllRequests(); while (enumerator.MoveNext()) { yield return null; } commonBasicResponseAsserts(matchingResponse); Directions.Step step0 = matchingResponse.Matchings[0].Legs[0].Steps[0]; Directions.Step step1 = matchingResponse.Matchings[0].Legs[0].Steps[1]; Assert.AreEqual("Fahren Sie Richtung Nordosten auf Rechte Wienzeile (B1)", step0.Maneuver.Instruction, "Step[0]:Instruction not as expected"); Assert.AreEqual("Sie haben Ihr Ziel erreicht", step1.Maneuver.Instruction, "Step[1]:Instruction not as expected"); }
public IEnumerator LanguageEnglish() { MapMatchingResource resource = new MapMatchingResource(); resource.Coordinates = new Vector2d[] { new Vector2d(48.1974721043879,16.36202484369278), new Vector2d(48.197922645046546,16.36285901069641) }; //set Steps to true to get turn-by-turn-instructions resource.Steps = true; //no language parameter needed: English is default MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); MapMatchingResponse matchingResponse = null; mapMatcher.Match( resource, (MapMatchingResponse response) => { matchingResponse = response; } ); IEnumerator enumerator = _fs.WaitForAllRequests(); while (enumerator.MoveNext()) { yield return null; } commonBasicResponseAsserts(matchingResponse); Directions.Step step0 = matchingResponse.Matchings[0].Legs[0].Steps[0]; Directions.Step step1 = matchingResponse.Matchings[0].Legs[0].Steps[1]; Assert.AreEqual("Head northeast on Rechte Wienzeile (B1)", step0.Maneuver.Instruction, "Step[0]:Instruction not as expected"); Assert.AreEqual("You have arrived at your destination", step1.Maneuver.Instruction, "Step[1]:Instruction not as expected"); }
public IEnumerator AllParameters() { MapMatchingResource resource = new MapMatchingResource(); resource.Profile = Profile.MapboxWalking; resource.Geometries = Geometries.Polyline6; resource.Coordinates = new Vector2d[] { new Vector2d(48.28585, 16.55267), new Vector2d(48.28933, 16.55211) }; resource.Timestamps = new long[] { 946684800, 946684980 }; resource.Radiuses = new uint[] { 50, 50 }; //set Steps to true to get turn-by-turn-instructions resource.Steps = true; //need to pass 'Overview.Full' to get 'Congestion' resource.Overview = Overview.Full; resource.Annotations = Annotations.Distance | Annotations.Duration | Annotations.Speed | Annotations.Congestion; resource.Tidy = true; resource.Language = InstructionLanguages.German; MapMatcher mapMatcher = new MapMatcher(_fs, _timeout); MapMatchingResponse matchingResponse = null; mapMatcher.Match( resource, (MapMatchingResponse response) => { matchingResponse = response; } ); IEnumerator enumerator = _fs.WaitForAllRequests(); while (enumerator.MoveNext()) { yield return(null); } commonBasicResponseAsserts(matchingResponse); Directions.Leg leg = matchingResponse.Matchings[0].Legs[0]; Assert.IsNotNull(leg.Annotation, "Annotation is NULL"); Assert.IsNotNull(leg.Annotation.Distance, "Distance is NULL"); Assert.IsNotNull(leg.Annotation.Duration, "Duration is NULL"); Assert.IsNotNull(leg.Annotation.Speed, "Speed is NULL"); Assert.IsNotNull(leg.Annotation.Congestion, "Congestion is NULL"); Directions.Step step1 = matchingResponse.Matchings[0].Legs[0].Steps[1]; Assert.IsTrue(step1.Maneuver.Instruction.Contains("Sie haben Ihr Ziel erreicht"), "Step[1]:Instruction not as expected"); }