DragonHeart.7201:

Hello everyone!

I was wondering what map libraries you guys have come across that are easy to use when it comes to handling GWs tile service. Do you guys have any recommendations? I came across a few myself, but haven’t decided which to use yet! Been looking through this section as well, but couldn’t find any info on suitable libraries for C#.

Regards, DragonHeart.

Stephane Lo Presti.7258:

Hi DragonHeart,

You can find some in this wiki article :
http://wiki.guildwars2.com/wiki/API:List_of_wrappers
(this is indicated in one of the forum sticky threads)

Other developers may want to chime in though, to talk about their personal experiences.

Have fun programming

timidobserver.7925:

https://gwapinet.codeplex.com/

Pros:
GwApiNet is solid and it seems to have all of the features they want it it listed at 100% complete. It helps that it is used in used on gw2stats.net, so you can browse there to see rather than take my word for it lol. Gw2stats.net is a very smoothly functioning site, so that leads me to believe that the library behind it is pretty solid.

Cons-ish:
The only downside is that the source pretty complicated, at least as a beginner/intermediateish C# dev, I find the source it a bit on the complicated side. Then again, I was trying to understand the source from top top bottom as opposed to just using library. As far as just using the library goes, there is documentation on the documentation tab and it isn’t that hard to wrap your mind around. Once you figure out how to use it, it is very nice.

Drakma.1549:

Gw2stats.net doesn’t run from that API. It’s something I built in house. However, gwapinet does have functionality built in to use the gw2stats.net API. Just wanted to clarify that.

From what I have seen though gwapinet is very awesome.

werdernator.6105:

Hey there, i actually tried that some time ago and got it to work with XAML (WPF-Application):


<Window x:Class="Gw2WvWMapInterface.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
        xmlns:a="clr-namespace:AnetTileProvider"
        Title="MainWindow" Height="500" Width="550">
    <Grid>
        <m:Map Name="mainMap" CredentialsProvider="[your bing key]" Background="White">
            <m:Map.Mode>
                <m:MercatorMode/>
            </m:Map.Mode>
            <a:AnetTileLayer UriFormat="https://tiles.guildwars2.com/2/1/{z}/{x}/{y}.jpg"></a:AnetTileLayer>
        </m:Map>
    </Grid>
</Window>


You need to download a dll from Microsoft to get that to work though (only you, not the user) and register for a Bing maps key (since that thing is Bing-Based)

also, for the custom Tile format to work, you need this code implemented:



namespace AnetTileProvider
{
    public class AnetTileSource : Microsoft.Maps.MapControl.WPF.TileSource
    {
        public override Uri GetUri(int x, int y, int zoomLevel)
        {
            return new Uri(UriFormat.
                           Replace("{x}", x.ToString()).
                           Replace("{y}", y.ToString()).
                           Replace("{z}", zoomLevel.ToString()));
        }
    }

    public class AnetTileLayer : Microsoft.Maps.MapControl.WPF.MapTileLayer
    {
        public AnetTileLayer()
        {
            TileSource = new AnetTileSource();
        }

        public string UriFormat
        {
            get { return TileSource.UriFormat; }
            set { TileSource.UriFormat = value; }
        }
    }
}

DragonHeart.7201:

Hey there, i actually tried that some time ago and got it to work with XAML (WPF-Application):


&lt;Window x:Class="Gw2WvWMapInterface.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
        xmlns:a="clr-namespace:AnetTileProvider"
        Title="MainWindow" Height="500" Width="550"&gt;
    &lt;Grid&gt;
        &lt;m:Map Name="mainMap" CredentialsProvider="[your bing key]" Background="White"&gt;
            &lt;m:Map.Mode&gt;
                &lt;m:MercatorMode/&gt;
            &lt;/m:Map.Mode&gt;
            &lt;a:AnetTileLayer UriFormat="https://tiles.guildwars2.com/2/1/{z}/{x}/{y}.jpg"&gt;&lt;/a:AnetTileLayer&gt;
        &lt;/m:Map&gt;
    &lt;/Grid&gt;
&lt;/Window&gt;


You need to download a dll from Microsoft to get that to work though (only you, not the user) and register for a Bing maps key (since that thing is Bing-Based)

also, for the custom Tile format to work, you need this code implemented:



namespace AnetTileProvider
{
    public class AnetTileSource : Microsoft.Maps.MapControl.WPF.TileSource
    {
        public override Uri GetUri(int x, int y, int zoomLevel)
        {
            return new Uri(UriFormat.
                           Replace("{x}", x.ToString()).
                           Replace("{y}", y.ToString()).
                           Replace("{z}", zoomLevel.ToString()));
        }
    }

    public class AnetTileLayer : Microsoft.Maps.MapControl.WPF.MapTileLayer
    {
        public AnetTileLayer()
        {
            TileSource = new AnetTileSource();
        }

        public string UriFormat
        {
            get { return TileSource.UriFormat; }
            set { TileSource.UriFormat = value; }
        }
    }
}

Thanks for the replies guys!

What werdernator mentioned is indeed what I’m looking for, I probably should have been a bit more clear, but I wasn’t looking for C# Wrappers that provide simple use of the GW API, but for an actual map control that can handle the “custom” tiles in C#.

I’ll definitely look into bing maps once I got time.

DragonHeart