Documentation and implementation

Aug 5, 2009 at 5:19 PM

Hi..

I've just found this great control and it seems to be just what i have been looking for. But i can't seem to find any documentation on the dll file.

I've downloaded the demo and i can't get that to compile, not even show the mainform. If i try to implement the code into my own project, i can't find the same properties (i.e. MaxZoom/MinZoom and so on).

Is there any documentation other that the demo, that explains how to use the control and not to forget, how to make it avaiable in my own project. I'm using C# (VS2008)

 

Forgive me, if i ask this. Everywhere i look, it always says it's easy and maybe i cant se the forest for the trees, but i can't wrap my head around this one...

 

/FStampe

Aug 5, 2009 at 5:38 PM

;}

first why you can't compile demo? what exactly errors you get?

Aug 5, 2009 at 8:00 PM

but i'll definitely keep idea about creating some usefull documentation

Aug 5, 2009 at 9:17 PM

Hi...

 

A lot of error about som xml namespaces. But i loaded the complete solution and that was not good. After i loaded only the Windows Forms project solo, my only problem was some reference problem about the dll files and the app.config file, that does not exist.

 

I renewed the references and deleted the app.config from the project at it compiled beautifully.

 

Still have som version trouble in my own project, but probably something i did wrong. Will have a look at it and will return if it keeps causing me problems..

BUT really looking forward to some documentation, but be sure that i think its a great job you have done

 

/FStampe

Aug 5, 2009 at 9:22 PM

great ;}

Aug 5, 2009 at 11:56 PM

Hi

 

Just an update.. Found out, that my problems compiling my own project was due to the fact, that i'm running on a x64 operating system and had my configuration to any cpu. As soon as i changed that to x86 as target cpu, it compiled without any problems and i'm now experimenting with the control. It said something about GMap.NET or a dependancy not being the correct fileformat. What must i do, in order to generate code with Any CPU as target?? I did reference the SQLite x64, aææthough i'm not quite sure what that dll is all about..

Really looking forward to do som geocoding. I'm planning to use it as map to a database of radioamateurs.. Will be great...

Still looking forward to a complete reference/documentation though ;-))))))))

 

Will return to my coding.. Thx..

 

/FStampe

Aug 6, 2009 at 5:22 AM

hey, well if you want run of all targets, you must use x86 dll and set your application target to it, so sqlite can work anywhere. The other idea is to use compact sql db provider, you can find it in patch list page, so your target can be 'any cpu' and it works on both sytems(x86 and x64), i do not test what cache speed speed it offers, but it should be ok

Aug 6, 2009 at 2:26 PM

Hi Radioman

 

i have tried to fidle a litte with directions.

 

Using this class for deserialization i get a different error, than using your..

{"Der kunne ikke oprettes en midlertidig klasse (result=1).\r\nerror CS0030: Typen 'StyleListStyleItemIcon[]' kan ikke konverteres til 'StyleListStyleItemIcon'\r\nerror CS0030: Typen 'kmlDocumentPlacemarkGeometryCollectionLineString[]' kan ikke konverteres til 'kmlDocumentPlacemarkGeometryCollectionLineString'\r\nerror CS0030: Typen 'kmlDocumentPlacemarkStyleMapPair[]' kan ikke konverteres til 'kmlDocumentPlacemarkStyleMapPair'\r\nerror CS0029: Typen 'kmlDocumentPlacemarkGeometryCollectionLineString' kan ikke implicit konverteres til 'kmlDocumentPlacemarkGeometryCollectionLineString[]'\r\nerror CS0029: Typen 'kmlDocumentPlacemarkStyleMapPair' kan ikke implicit konverteres til 'kmlDocumentPlacemarkStyleMapPair[]'\r\nerror CS0029: Typen 'StyleListStyleItemIcon' kan ikke implicit konverteres til 'StyleListStyleItemIcon[]'\r\n"}

It basically states, that it can't convert 'StyleListStyleItemIcon[] to StyleListStyleItemIcon and so on.. The phrase 'kan ikke konverteres til' means 'cannot convert to'.. With your KmlType deserialization the exception is around reflection. I'm not familiar with deserilization so maybe you can figure out what happends. The classes below are genereted from an xml dump of the kmls string. Does that help you i any way??

/FStampe

 

//------------------------------------------------------------------------------
// <auto-generated>
//     Denne kode blev oprettet ved hjælp af et værktøj.
//     Runtime-version:2.0.50727.4016
//
//     Ændringer af denne fil kan resultere i ukorrekt funktion, og ændringerne mistes, hvis
//     koden oprettes igen.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

//
// This source code was auto-generated by xsd, Version=2.0.50727.42.
//


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://earth.google.com/kml/2.0", IsNullable = false)]
public partial class Style
{

    private StyleLineStyle[] lineStyleField;

    private StyleIconStyle[] iconStyleField;

    private StyleListStyleItemIcon[][] listStyleField;

    private string idField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("LineStyle")]
    public StyleLineStyle[] LineStyle
    {
        get
        {
            return this.lineStyleField;
        }
        set
        {
            this.lineStyleField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("IconStyle")]
    public StyleIconStyle[] IconStyle
    {
        get
        {
            return this.iconStyleField;
        }
        set
        {
            this.iconStyleField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayItemAttribute("ItemIcon", typeof(StyleListStyleItemIcon), IsNullable = false)]
    public StyleListStyleItemIcon[][] ListStyle
    {
        get
        {
            return this.listStyleField;
        }
        set
        {
            this.listStyleField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string id
    {
        get
        {
            return this.idField;
        }
        set
        {
            this.idField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class StyleLineStyle
{

    private string colorField;

    private string widthField;

    /// <remarks/>
    public string color
    {
        get
        {
            return this.colorField;
        }
        set
        {
            this.colorField = value;
        }
    }

    /// <remarks/>
    public string width
    {
        get
        {
            return this.widthField;
        }
        set
        {
            this.widthField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class StyleIconStyle
{

    private string scaleField;

    private StyleIconStyleIcon[] iconField;

    private StyleIconStyleHotSpot[] hotSpotField;

    /// <remarks/>
    public string scale
    {
        get
        {
            return this.scaleField;
        }
        set
        {
            this.scaleField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Icon")]
    public StyleIconStyleIcon[] Icon
    {
        get
        {
            return this.iconField;
        }
        set
        {
            this.iconField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("hotSpot")]
    public StyleIconStyleHotSpot[] hotSpot
    {
        get
        {
            return this.hotSpotField;
        }
        set
        {
            this.hotSpotField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class StyleIconStyleIcon
{

    private string hrefField;

    /// <remarks/>
    public string href
    {
        get
        {
            return this.hrefField;
        }
        set
        {
            this.hrefField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class StyleIconStyleHotSpot
{

    private string xField;

    private string yField;

    private string xunitsField;

    private string yunitsField;

    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string x
    {
        get
        {
            return this.xField;
        }
        set
        {
            this.xField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string y
    {
        get
        {
            return this.yField;
        }
        set
        {
            this.yField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string xunits
    {
        get
        {
            return this.xunitsField;
        }
        set
        {
            this.xunitsField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string yunits
    {
        get
        {
            return this.yunitsField;
        }
        set
        {
            this.yunitsField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class StyleListStyleItemIcon
{

    private string hrefField;

    /// <remarks/>
    public string href
    {
        get
        {
            return this.hrefField;
        }
        set
        {
            this.hrefField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://earth.google.com/kml/2.0", IsNullable = false)]
public partial class kml
{

    private object[] itemsField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Document", typeof(kmlDocument))]
    [System.Xml.Serialization.XmlElementAttribute("Style", typeof(Style))]
    public object[] Items
    {
        get
        {
            return this.itemsField;
        }
        set
        {
            this.itemsField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class kmlDocument
{

    private string nameField;

    private string snippetField;

    private Style[] styleField;

    private kmlDocumentPlacemark[] placemarkField;

    /// <remarks/>
    public string name
    {
        get
        {
            return this.nameField;
        }
        set
        {
            this.nameField = value;
        }
    }

    /// <remarks/>
    public string Snippet
    {
        get
        {
            return this.snippetField;
        }
        set
        {
            this.snippetField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Style")]
    public Style[] Style
    {
        get
        {
            return this.styleField;
        }
        set
        {
            this.styleField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Placemark")]
    public kmlDocumentPlacemark[] Placemark
    {
        get
        {
            return this.placemarkField;
        }
        set
        {
            this.placemarkField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class kmlDocumentPlacemark
{

    private string nameField;

    private string descriptionField;

    private string styleUrlField;

    private string addressField;

    private kmlDocumentPlacemarkGeometryCollectionLineString[][] geometryCollectionField;

    private kmlDocumentPlacemarkStyleMapPair[][] styleMapField;

    private kmlDocumentPlacemarkPoint[] pointField;

    private kmlDocumentPlacemarkLookAt[] lookAtField;

    /// <remarks/>
    public string name
    {
        get
        {
            return this.nameField;
        }
        set
        {
            this.nameField = value;
        }
    }

    /// <remarks/>
    public string description
    {
        get
        {
            return this.descriptionField;
        }
        set
        {
            this.descriptionField = value;
        }
    }

    /// <remarks/>
    public string styleUrl
    {
        get
        {
            return this.styleUrlField;
        }
        set
        {
            this.styleUrlField = value;
        }
    }

    /// <remarks/>
    public string address
    {
        get
        {
            return this.addressField;
        }
        set
        {
            this.addressField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayItemAttribute("LineString", typeof(kmlDocumentPlacemarkGeometryCollectionLineString), IsNullable = false)]
    public kmlDocumentPlacemarkGeometryCollectionLineString[][] GeometryCollection
    {
        get
        {
            return this.geometryCollectionField;
        }
        set
        {
            this.geometryCollectionField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlArrayItemAttribute("Pair", typeof(kmlDocumentPlacemarkStyleMapPair), IsNullable = false)]
    public kmlDocumentPlacemarkStyleMapPair[][] StyleMap
    {
        get
        {
            return this.styleMapField;
        }
        set
        {
            this.styleMapField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Point")]
    public kmlDocumentPlacemarkPoint[] Point
    {
        get
        {
            return this.pointField;
        }
        set
        {
            this.pointField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("LookAt")]
    public kmlDocumentPlacemarkLookAt[] LookAt
    {
        get
        {
            return this.lookAtField;
        }
        set
        {
            this.lookAtField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class kmlDocumentPlacemarkGeometryCollectionLineString
{

    private string coordinatesField;

    /// <remarks/>
    public string coordinates
    {
        get
        {
            return this.coordinatesField;
        }
        set
        {
            this.coordinatesField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class kmlDocumentPlacemarkStyleMapPair
{

    private string keyField;

    private Style[] styleField;

    /// <remarks/>
    public string key
    {
        get
        {
            return this.keyField;
        }
        set
        {
            this.keyField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Style")]
    public Style[] Style
    {
        get
        {
            return this.styleField;
        }
        set
        {
            this.styleField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class kmlDocumentPlacemarkPoint
{

    private string coordinatesField;

    /// <remarks/>
    public string coordinates
    {
        get
        {
            return this.coordinatesField;
        }
        set
        {
            this.coordinatesField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://earth.google.com/kml/2.0")]
public partial class kmlDocumentPlacemarkLookAt
{

    private string longitudeField;

    private string latitudeField;

    private string rangeField;

    private string tiltField;

    private string headingField;

    /// <remarks/>
    public string longitude
    {
        get
        {
            return this.longitudeField;
        }
        set
        {
            this.longitudeField = value;
        }
    }

    /// <remarks/>
    public string latitude
    {
        get
        {
            return this.latitudeField;
        }
        set
        {
            this.latitudeField = value;
        }
    }

    /// <remarks/>
    public string range
    {
        get
        {
            return this.rangeField;
        }
        set
        {
            this.rangeField = value;
        }
    }

    /// <remarks/>
    public string tilt
    {
        get
        {
            return this.tiltField;
        }
        set
        {
            this.tiltField = value;
        }
    }

    /// <remarks/>
    public string heading
    {
        get
        {
            return this.headingField;
        }
        set
        {
            this.headingField = value;
        }
    }
}

Aug 6, 2009 at 6:55 PM

wellnot so much,you seethese classes are autogenerated, so they should work, but they don't, so... ;/

Aug 6, 2009 at 7:44 PM

Hi

No, i feared as much. It's irretating to have this problem. I found another project, where the person claims he's able to deserialize the kml, but i've tried his code and it does finish error free, but still returns a null reference..

I'm wondering if the solution would be to parse the xml manually, returning an object created without automation by the xmlserializer or perhaps setting up a dataset from the xml data. I've not actually studied the code or the xsd, but a dataset from the schema may also be a possibillity.

Doing it manually should be possible, all be it more labour intensive... May have a look at it, but i make no promisses to any success... ;-)

/FStampe

Aug 6, 2009 at 7:46 PM

great ;}

Aug 7, 2009 at 8:00 AM

Can you direct me to where you got the info about the http requests for info??

If i want to use the API i need a key and the xml comming here, does not seem to hold data usable enough for direction i text

 

/FStampe

Aug 7, 2009 at 8:31 AM

http://code.google.com/apis/kml/documentation/

Aug 7, 2009 at 9:46 AM

Thx. Been by that site, but can't seem to find information on how you generate the url from where you get the XML..

Also been studying the xml. It does not seem to hold the turn-by-turn driving instructions, which from my point of use, are the most interesting part of the equation. The xml from the deserialization routine holds information about the route and how to plot it on the map and there must be at least some kind of calculations i'm not aware of in between or, which i consider far more likely, that information is not given by that call to the api.

Study of various java examples, including the advanced route example on google, seems to indicate that the only release that as an image they generate. If so, it would be nice to find uot on what url i cal get that image, since i hope it would not be required to use the html/javascript approach to that..

/FStampe

Aug 7, 2009 at 9:52 AM

check: GMaps.GetRouteBetweenPointsKmlUrl(string url)

Aug 7, 2009 at 10:07 AM

I have been, but that ends up down in the exception catch, with the original kml class it returns a reflection error. With the above class it has som conversion errors.

It is also that xml i have studied and it does not seem to hold turn-by-turn information, like i said above.. It has a set of coordinates at the buttom, but they only mark out the route. If they are all you get, then you have to translate them back into adresses and find out wether it's aright or left turn and also the distance back from the last point. Not impossible, but it seems to possibly be a lot of reverse geocoding to be done, in order to produce that turn-by-turn list..

Am i missing something or is it your take on that xml, that you have to do reverse geocoding, in order to have and textual representation of the route??

/FStampe

Aug 7, 2009 at 11:07 AM

hm... maybe you should start decoding this:

http://maps.google.com/maps?f=d&source=s_d&saddr=Gele%C5%BEinio+Vilko+gatv%C4%97&daddr=Savanori%C5%B3+prospektas&hl=en&geocode=FURsQgMd1nSBAQ%3BFSSxRQMdGLtsAQ&mra=ls&vps=3&output=js&jsv=170f&sll=54.310114,24.576416&sspn=2.519084,7.113647

http://maps.google.com/maps?f=d&source=s_d&saddr=Gele%C5%BEinio+Vilko+gatv%C4%97&daddr=Savanori%C5%B3+prospektas&hl=en&mra=ls&vps=3&output=js&jsv=170f

 

Aug 7, 2009 at 2:51 PM

I've had a look at the Google Map API reference, and as often is the case, Google is your friend.

As it turns out, your url you generate in MakeRouteAndDirectionsKmlUrl restricts the output from the Google API. It's too soon to say what the difference i found is excactly, but i have removed some parameters and now i get a kml result many times bigger, with all the turn by turn information contained i raw text and in KML nodes.

I have found some libs on the net, that can deserialize the KML, since you cannot use the standard XMLSerializer in the framework. There are some key differences between xml and kml and that is what causes the problems with the deserialization. I'm not trained enough to make anything out of that, but maybe you are. libkml from google is capable of doing that.

I will try to do a textbased parse of the data, to turn it into an object which can be handled further. I will keep you up to date with my progress either thrue this discussion or direct via mail.

/FStampe

Aug 7, 2009 at 5:09 PM

great!

Aug 11, 2009 at 10:25 AM

Hi Radioman

Okay.. Been working over the weekend and have come up with the following...

if created a class, that exposes the following properties:

 

public string UserAgent = "Opera/9.62 (Windows NT 5.1; U; en) Presto/2.1.1";/// <summary> <font size="2">

 

</font>

public int Timeout = 30 * 1000;/// <summary> <font size="2">

 

</font>

public WebProxy Proxy;

public XmlType Xml = new XmlType();

public string XmlNameSpace;

public string name;

public string Language = "da";

public PointLatLng Start;

public PointLatLng End;

public StyleType Style = new StyleType();

public SnippetType Snippet = new SnippetType();

public List<KmlPlacemark> Placemarks = new List<KmlPlacemark>();

<font size="2">

 

</font>

public string UserAgent = "Opera/9.62 (Windows NT 5.1; U; en) Presto/2.1.1";<font size="2">

 

</font>

/// <summary>

<font size="2">

 

</font>

/// timeout for map connections

<font size="2">

 

</font>

/// </summary>

<font size="2">

 

</font>

public int Timeout = 30 * 1000;<font size="2">

 

</font>

/// <summary>

<font size="2">

 

</font>

/// proxy for net access

<font size="2">

 

</font>

/// </summary>

<font size="2">

 

</font>

public WebProxy Proxy;<font size="2">

 

</font>

public XmlType Xml = new XmlType();<font size="2">

 

</font>

public string XmlNameSpace;<font size="2">

 

</font>

public string name;<font size="2">

 

</font>

public string Language = "da";<font size="2">

 

</font>

public PointLatLng Start;<font size="2">

 

</font>

public PointLatLng End;<font size="2">

 

</font>

public StyleType Style = new StyleType();<font size="2">

 

</font>

public SnippetType Snippet = new SnippetType();<font size="2">

 

</font>

public List<KmlPlacemark> Placemarks = new List<KmlPlacemark>();<font size="2">

 

</font>

public List<string> RAWKml = new List<string>();

 

<font size="2">

 

</font>

 

You instantiate the object with this call:

 

<font size="2">

 

</font>

 

public KmlRoute(PointLatLng start, PointLatLng end, string language, bool

avoidHighways)

{

Language = language;

Start = start;

End = end;

GetRouteBetweenPointsKml(start, end, avoidHighways);

}

It then goes on to get the reoute from Google, the RAWKml, and does its thing.. Heres a run through of its actions:

1) Set start, end, language, highways according to instantiation (Pretty much what you already did)

2) Generate the appropriate Url and call Google API (Also taken from the original class)

3) It rips the kml string appart into RAWKml, that is exposes for further use by enduser (From here on out its new stuff)

4) if then itterates through the RAWKml setting the KMLDocument elements in the public properties.

5) Returns from instantiation

 

I'm planning to be able to instantiate with either strings for start,end or PointLatLng for start, end or without any parameters. At the moment you have to supply PointLatLng. regardless of instatiation, both lat,lon and strings for start,end will be exposed.

Also planning to make turn-by-turn available even more accessable than now. Now the info is located in the placemark list in the object. Figured i would make a objecttype that held the info more straight forward and an method for returning these infos..

 

Could i email you my work??

Also i would like comments on the above mentioned.

The code is somewhat testet, but further test would be appreciated, since i can't test my own code 100%

/FStampe

Aug 11, 2009 at 11:38 AM

just upload there, i'll test it as soon as i can: http://gmap4dotnet.codeplex.com/SourceControl/UploadPatch.aspx

Nov 10, 2009 at 12:02 PM
Edited Nov 10, 2009 at 2:20 PM

I'm also in need of retrieving the directions from A to B like this. Did this ever get implemented?

I've been looking at Google Maps API for how this is done, and basically it mentions you need GDirections...

As in their example http://code.google.com/apis/maps/documentation/examples/directions-simple.html

Could you suggest how to implement something similar?

Nov 10, 2009 at 2:09 PM

it's part of no kml support, there is few implementation by manual parsing kml files in patches...

Nov 11, 2009 at 10:05 AM

Worked on this last night, and have a solution which I've uploaded to you. Hope this can be of use to you and enhance an already excellent project.

Thanks for all your help to-date