public static void DirectGeocoding(int inX, int inY, int inMaxTime) { LONGPOSITION lp = new LONGPOSITION(inX, inY); string strAddress = ""; SRoadInfo sri = new SRoadInfo(); int ret = CApplicationAPI.GetLocationInfo(out _mySError, lp, out strAddress, out sri, inMaxTime); O("GetLocationInfo returns: " + ret + ", errorcode: " + MySError.nCode.ToString()); if (ret == 1) { O("lRoadOffset: " + sri.lRoadOffset.ToString()); O("OnroadPosition: X:" + sri.OnroadPosition.lX.ToString() + " Y: " + sri.OnroadPosition.lY.ToString()); O("OffroadDistance:" + sri.dwOffroadDistance); O("IsCongestionCharge: " + sri.IsCongestionCharge.ToString()); O("IsFerry: " + sri.IsFerry.ToString()); O("IsoCode: " + sri.IsoCode.ToString()); O("IsPaved: " + sri.IsPaved.ToString()); O("IsProhibited: " + sri.IsProhibited.ToString()); O("IsTollRoad: " + sri.IsTollRoad.ToString()); O("IsTunnel: " + sri.IsTunnel.ToString()); O("IsUrban: " + sri.IsUrban.ToString()); O("RoadClass: " + sri.RoadClass.ToString()); O("SpeedCategory: " + sri.SpeedCategory.ToString()); O("SpeedRestriction: " + sri.SpeedRestriction.ToString()); O("strAddress: " + strAddress); } int ret2 = CApplicationAPI.ShowCoordinatesOnMap(out _mySError, lp, 2, true, 0); O("ShowCoordinatesOnMap returns: " + ret2.ToString()); }
public static void LocationFromAddress(string inStrAddress, bool inBPostal, bool inBValueMatch, int inMaxTime) { LONGPOSITION location; int ret = CApplicationAPI.LocationFromAddress(out _mySError, out location, inStrAddress, inBPostal, inBValueMatch, inMaxTime); O("LocationFromAddressEx returns: " + ret.ToString()); if (ret == 1) { string tmpAddress; CApplicationAPI.GetLocationInfo(out _mySError, location, out tmpAddress, inMaxTime); O("x=" + location.lX.ToString() + ", y=" + location.lY.ToString() + ", address:" + tmpAddress); } }
public static void LocationFromAddressEx(string inStrAddress, bool inBPostal, bool inBFuzzySearch, int inMaxTime) { SWayPoint[] wps; string tmpString = ""; int ret = CApplicationAPI.LocationFromAddressEx(out _mySError, inStrAddress, inBPostal, inBFuzzySearch, out wps, inMaxTime); O("LocationFromAddressEx returns: " + ret.ToString()); if (wps != null) { for (int i = 0; i < wps.Length; i++) { CApplicationAPI.GetLocationInfo(out _mySError, wps[i].Location, out tmpString, 0); O("x= " + wps[i].Location.lX + ", y= " + wps[i].Location.lY + ", address: " + tmpString); } } }