Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:06:12+00:00 2026-06-16T03:06:12+00:00

Situation: I have 3 web references (xMap, xLocation, xRoute) xMap is dedicated to generating

  • 0

Situation:
I have 3 web references (xMap, xLocation, xRoute)
xMap is dedicated to generating maps.
xLocation is dedicated to locating places.
xRoute is dedicated to generating routes.

I am using a simple GUI to display the map and inputting locations for the start and destination routes.

These are my errors.

Error 1 Cannot implicitly convert type ‘Plantool.xRoute.LineString[]’
to ‘Plantool.xMap.LineString[]’

Error 2 The best overloaded method match for
‘Plantool.xMap.XMapWSService.renderMapBoundingBox(Plantool.xMap.BoundingBox,
Plantool.xMap.MapParams, Plantool.xMap.ImageInfo,
Plantool.xMap.Layer[], bool, Plantool.xMap.CallerContext)’ has some
invalid arguments

Error 3 Argument ‘1’: cannot convert from
‘Plantool.xRoute.BoundingBox’ to ‘Plantool.xMap.BoundingBox’

I am guessing that PTV xServer’s duplicate methods/features/etc are the same as xMap, xLocate, xRoute are optional modules. It is probably a simple answer is there a solution to this?

I am looking a head for a long trip home and spend an additional addicted half an hour of overtime on this code. And hi, I’m new.

Below his my class.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Plantool.xMap;
using Plantool.xLocate;
using Plantool.xRoute;

namespace Plantool
{
    class ClassMap
    {
        /*
         * xServer clients
         */
        private static XMapWSService xMapClient = new XMapWSService();
        private static XRouteWSService xRouteClient = new XRouteWSService();
        private static XLocateWSService xLocateClient = new XLocateWSService();

        /* getLocation()
         * Input: Address string
         * Output: WKT (Well-Known-Text) Location
         * Edited 20/12/12 - Davide Nguyen
         */
        public string getLocation(string input)
        {
            // create the adress object
            string[] address = input.Split(',');
            Address addr = new Address();
            addr.country = address[0];
            addr.city = address[1];
            addr.postCode = address[2];

            // call findAddress on the xLocate server  
            // only the first argument of findAddress is mandatory,  
            // all others are nullable (see xLocate API documentation)
            AddressResponse response = xLocateClient.findAddress(addr, null, null, null, null);

            string result = "";
            foreach (ResultAddress ra in response.wrappedResultList)
            {
                result += String.Format("POINT( {0} {1}) ", ra.coordinates.point.x, ra.coordinates.point.y);
            }
            string result2 = result.Replace(",", ".");
            return result2;
        }

        /* route()
         * Input: Start address, Destination address
         * Output: string[] [0] DISTANCE [1] TIME [2] MAP
         * Edited 20/12/12 - Davide Nguyen
         */
        public string[] route(string startlocation, string destination)
        {
            #region WaypointDesc[]
            // create the WayPoint for the Start
            // ATTENTION: Here at the object WaypointDesc the parameters are not named
            // "coords" as described within the documentation but
            // "wrappedCoords"
            WaypointDesc wpdStart = new WaypointDesc();
            // please note that this has to be an array of Point...
            wpdStart.wrappedCoords = new xRoute.Point[] { new xRoute.Point() };
            wpdStart.wrappedCoords[0].wkt = getLocation(startlocation);

            // Waypoint for the Destination...
            WaypointDesc wpdDestination = new WaypointDesc();
            wpdDestination.wrappedCoords = new xRoute.Point[] { new xRoute.Point() };
            wpdDestination.wrappedCoords[0].wkt = getLocation(destination);

            // create a new array of WayPointDescriptions and fill it with Start and Destination
            WaypointDesc[] waypointDesc = new WaypointDesc[] { wpdStart, wpdDestination };
            #endregion

            try
            {
                // Route
                Route route = calculateRoute(waypointDesc);

                // Map
                string DisplayMapURL = createMap(waypointDesc, route);

                // get route info
                string[] routeinfo = getRouteInfo(waypointDesc);

                // Create the result
                string[] result = new string[3];
                result[0] = routeinfo[0]; // Distance
                result[1] = routeinfo[1]; // Time
                result[2] = DisplayMapURL;// Map URL

                // Return the result
                return result;
            }
            catch
            {
                throw new NotImplementedException();
            }
        }

        /* getRouteInfo()
         * Input: WaypointDesc[]
         * Output: string mapURL
         * Edited 20/12/12 - Davide Nguyen
         */
        private static string createMap(WaypointDesc[] waypointDesc, Route route)
        {
            #region boundingBox
            // Set boundingBox fand use corners from the calculated route
            xRoute.BoundingBox boundingBox = new xRoute.BoundingBox();
            boundingBox.leftTop = route.totalRectangle.rightTop;
            boundingBox.rightBottom = route.totalRectangle.leftBottom;
            #endregion

            #region mapParams
            // Build mapParams
            MapParams mapParams = new MapParams();
            mapParams.showScale = true;
            mapParams.useMiles = false;
            #endregion

            #region imageInfo
            // Create imageInfo and set the frame size and image format. NOTE: 1052; 863
            ImageInfo imageInfo = new ImageInfo();
            imageInfo.format = ImageFileFormat.PNG;
            imageInfo.height = 1052;
            imageInfo.width = 863;
            imageInfo.imageParameter = "";
            #endregion

            #region layers
            // Create a line from the calculated route
            xRoute.LineString[] lineStrings = new xRoute.LineString[] { route.polygon };
            Lines[] lines = new Lines[1];
            LineOptions options = new LineOptions();
            LinePartOptions partoptions = new LinePartOptions();
            partoptions.color = new Color();
            partoptions.visible = true;
            partoptions.width = -10;
            options.mainLine = partoptions;

            lines[0] = new Lines();
            lines[0].wrappedLines = lineStrings;                                                                                    //NEED HELP
            lines[0].options = options;

            // Define customLayer that contains the object lines and set layers.
            CustomLayer customLayer = new CustomLayer();
            customLayer.visible = true;
            customLayer.drawPriority = 100;
            customLayer.wrappedLines = lines;
            customLayer.objectInfos = ObjectInfoType.NONE;
            customLayer.centerObjects = true;
            Layer[] layers = new Layer[] { customLayer };
            #endregion

            #region includeImageInResponse
            // Set argument includeImageInResponse to false (default).
            Boolean includeImageInResponse = false;
            #endregion

            // Return object map using the following method.
            Map map = xMapClient.renderMapBoundingBox(boundingBox, mapParams, imageInfo, layers, includeImageInResponse, null);     // NEED HELP

            // Retrieve the image
            string result = "http://" + map.image.url;

            // Return the drawn map
            return result;
        }

        /* getRouteInfo()
         * Input: WaypointDesc[]
         * Output: string[] [0] Distance in M [1] Time in H:M:S:MS
         * Edited 20/12/12 - Davide Nguyen
         */
        private string[] getRouteInfo(WaypointDesc[] waypointDesc)
        {
            // Call the service
            RouteInfo routeInfo = xRouteClient.calculateRouteInfo(waypointDesc, null, null, null);

            // Create the result
            TimeSpan t = TimeSpan.FromSeconds(routeInfo.time);
            string[] result = new string[2];
            result[0] = string.Format("{0} KM", routeInfo.distance);
            result[1] = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms", t.Hours, t.Minutes, t.Seconds, t.Milliseconds);

            // Return the result
            return result;
        }

        /* getRouteLines() 
         * Input: WaypointDesc[]
         * Output: Route object
         * Edited 20/12/12 - Davide Nguyen
         */
        private static Route calculateRoute(WaypointDesc[] waypointDesc)
        {
            #region ResultListOptions
            // Instantiate a new object resultListOPtions
            ResultListOptions resultListOptions = new ResultListOptions();
            resultListOptions.polygon = true;
            resultListOptions.totalRectangle = true;
            resultListOptions.detailLevel = DetailLevel.STANDARD;
            #endregion

            #region CallerContext/CallerContextPropery
            // Create a new CallerContextProperty object property
            xRoute.CallerContextProperty property = new xRoute.CallerContextProperty();
            property.key = "ResponseGeometry";
            property.value = "WKT";
            xRoute.CallerContext callerContext = new xRoute.CallerContext();
            callerContext.wrappedProperties = new xRoute.CallerContextProperty[] { property };
            #endregion

            // Call the service
            Route route = xRouteClient.calculateRoute(waypointDesc, null, null, resultListOptions, callerContext);

            return route;
        }

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:06:14+00:00Added an answer on June 16, 2026 at 3:06 am

    There seems to be some reference confusion between these two.

    using Plantool.xMap;
    using Plantool.xRoute;
    

    You could delete these:

    using Plantool.xMap;
    using Plantool.xLocate;
    using Plantool.xRoute;
    

    And just add this:

    using Plantool;
    

    And then explicitly reference the correct types, ensuring you are referencing the one that is required. This should solve all three error messages.

    Ideally, you should avoid having name-clashes where only the namespace is different. In the .NET framework you’ll notice that they take care to avoid this, for example…

    System.Data.Odbc.OdbcConnection
     System.Data.SqlClient.SqlConnection
    

    They could have both been called Connection, given that one is in the Odbc namespace and one is in the SqlClient namespace – but this could lead to the problem you have.

    By renaming LineString to RouteLineString and MapLineString you can avoid the confusion in your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I'm using some markup in 2 places on a
My Situation I have developed a web service for document analysis This web service
I have this situation: web application with cca 200 concurent requests (Threads) are in
Here is the situation : we have to offer a customer with a web-based
I'll try to describe the situation. We have a web service; on each request
I have following situation: String a = A Web crawler is a computer program
I have a situation where i call a web service and it returns me
Here's my situation. I have a web root and several subdirectories, let's say: /var/www
Here is my situation. I have a web page for users to create their
So this is my situation. I have to consume a third party web service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.