This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to add User-Agent to GMap Interface

0

Hello Everyone,

I am trying to access OpenStreetMaps as my Map Provider through the GMaps interface, however I am getting a "Exception: The remote server returned an error: (403) Forbidden" I believe this is because I do not have the User-Agent or Referrer set.

Can anyone please show me an example of how I would set the User-Agent using the GMap interface.

Using WPF c#

Thank you!

asked 25 Jun '19, 20:47

cferreira1992's gravatar image

cferreira1992
11223
accept rate: 0%


One Answer:

1

I'm not familiar with GMap but according to the Internet you can use something like:

GMap.NET.MapProviders.OpenStreetMapProvider.UserAgent = "cferreira GMap tool 1.0";

or

GMap.NET.MapProviders.GMapProvider.UserAgent = "cferreira GMap tool 1.0";

Unsure which one works, please come back and tell us.

answered 26 Jun '19, 08:15

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

Source code available on GitHub .