C# Map libraries
Content Marketing Manager, French
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
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.
(edited by timidobserver.7925)
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.
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; }
}
}
}
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; } } } }
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