judero01col / GMap.NET

GMap.NET Windows Forms & Presentation is an excellent open source, powerful, free and cross-platform .NET control. Allows the use of routing, geocoding, directions and maps from Google, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, SigPac, Yendux, Mapy.cz, Maps.lt, iKarte.lv, NearMap, HereMap, CloudMade, WikiMapia, MapQuest and many more.
Other
463 stars 202 forks source link

Gmap how to set Google ApiKey in WPF? #51

Closed Kiruhasdc closed 5 years ago

Kiruhasdc commented 5 years ago

Hello everyone. My program is on WPF and I need my Google ApiKey to use Directions API for creating routes. In Windows Forms I use GMap.NET.MapProviders.GMapProviders.GoogleMap.ApiKey="My ApiKey" But I couldn't find how to do it in WPF. Please, help me.

Loki606 commented 5 years ago

I think it's not working in WinForms either. Could be a Google thing. I read somewhere that they started crying about terms and conditions regarding GMap.

judero01col commented 5 years ago

Greetings, is implemented in the same way, could you solve the inconvenience?

Loki606 commented 5 years ago

Hi,

No, I couldn't. I had an API key that worked on Xamarin and it's not working with WinForms for some reason.

Anyway, I ended up using HereMap as a provider, but I see that there is no function to return structured data when reverse geocoding. I made myself a custom HttpRequest, but is there is little info about HereMaps in GMap.

Regards, Laszlo

On Fri, Aug 23, 2019, 03:30 Jurgen De León Rodriguez < notifications@github.com> wrote:

Greetings, is implemented in the same way, could you solve the inconvenience?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/judero01col/GMap.NET/issues/51?email_source=notifications&email_token=AMHNNCYZGHQZEGSOSLYFYGLQF4VT7A5CNFSM4IJFXYLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46Y2AA#issuecomment-524127488, or mute the thread https://github.com/notifications/unsubscribe-auth/AMHNNC4OGJ4WTPUFHHSDSVTQF4VT7ANCNFSM4IJFXYLA .

judero01col commented 5 years ago

check if your api has restriction of use in android applications only.

https://console.cloud.google.com/apis/credentials?hl=es-419

image

image

Loki606 commented 5 years ago

Hi,

I checked it the first time, there were no restrictions at all for the key.

I also went ahead and created OAuth2 credentials and tried adding them with the SetEnterpriseCredentials method. Waited for about 30 minutes and then what happened was it started freezing the window where I had my GMap. That's when I decided to go for another provider instead.

Regards, Laszlo

On Fri, Aug 23, 2019, 03:51 Jurgen De León Rodriguez < notifications@github.com> wrote:

check if your api has restriction of use in android applications only.

https://console.cloud.google.com/apis/credentials?hl=es-419

[image: image] https://user-images.githubusercontent.com/22176530/63559213-eea0a000-c515-11e9-8902-915dbb575ff0.png

[image: image] https://user-images.githubusercontent.com/22176530/63559251-2e678780-c516-11e9-85c5-b9ca56f4228b.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/judero01col/GMap.NET/issues/51?email_source=notifications&email_token=AMHNNC6DHPGG22FEWIW6TLDQF4YCJA5CNFSM4IJFXYLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46ZVVI#issuecomment-524131029, or mute the thread https://github.com/notifications/unsubscribe-auth/AMHNNC3GNLN6ME3A7BX7NWLQF4YCJANCNFSM4IJFXYLA .

Loki606 commented 5 years ago

I have a vague idea that it could be caused by some other libraries I have in project. I am also using Firesharp and GoogleAPI libraries.

... didn't get around to test that theory.

Regards, Laszlo

On Fri, Aug 23, 2019, 04:07 Laszlo Kovacs kovandras91@gmail.com wrote:

Hi,

I checked it the first time, there were no restrictions at all for the key.

I also went ahead and created OAuth2 credentials and tried adding them with the SetEnterpriseCredentials method. Waited for about 30 minutes and then what happened was it started freezing the window where I had my GMap. That's when I decided to go for another provider instead.

Regards, Laszlo

On Fri, Aug 23, 2019, 03:51 Jurgen De León Rodriguez < notifications@github.com> wrote:

check if your api has restriction of use in android applications only.

https://console.cloud.google.com/apis/credentials?hl=es-419

[image: image] https://user-images.githubusercontent.com/22176530/63559213-eea0a000-c515-11e9-8902-915dbb575ff0.png

[image: image] https://user-images.githubusercontent.com/22176530/63559251-2e678780-c516-11e9-85c5-b9ca56f4228b.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/judero01col/GMap.NET/issues/51?email_source=notifications&email_token=AMHNNC6DHPGG22FEWIW6TLDQF4YCJA5CNFSM4IJFXYLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46ZVVI#issuecomment-524131029, or mute the thread https://github.com/notifications/unsubscribe-auth/AMHNNC3GNLN6ME3A7BX7NWLQF4YCJANCNFSM4IJFXYLA .

judero01col commented 5 years ago

Do you have your project invoice activated in the Google console?

judero01col commented 5 years ago

Could I give you the error that is regenerating it?

I'm going to try on my computer now to see my due to some change made by google.

Loki606 commented 5 years ago

Don't know what that is so I'm assuming not.

On Fri, Aug 23, 2019, 04:12 Jurgen De León Rodriguez < notifications@github.com> wrote:

Do you have your project invoice activated in the Google console?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/judero01col/GMap.NET/issues/51?email_source=notifications&email_token=AMHNNC5Y7ZDPWP5LOAATQNDQF42PZA5CNFSM4IJFXYLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD462Q4A#issuecomment-524134512, or mute the thread https://github.com/notifications/unsubscribe-auth/AMHNNC5ACC6JRUWJ7ZAVFALQF42PZANCNFSM4IJFXYLA .

judero01col commented 5 years ago

https://console.cloud.google.com/billing?hl=es-419&organizationId=0

Enter through this link and from there you can configure it, google policies require that you must have an active billing account, connected to the project to which the apikey belongs, to activate the invoice you must link a payment method.

Google gives you a monthly credit of 200 USD, to consume all its api, if you go over that limit, you will be charged for exceeding it.

image

Loki606 commented 5 years ago

Fuuuuck.. it worked. Thank you so much! You are awesome for sticking it out with me like this. :D

On Fri, Aug 23, 2019, 04:37 Jurgen De León Rodriguez < notifications@github.com> wrote:

Enter through this link and from there you can configure it, google policies require that you must have an active billing account, connected to the project to which the apikey belongs, to activate the invoice you must link a payment method.

Google gives you a monthly credit of 200 USD, to consume all its api, if you go over that limit, you will be charged for exceeding it.

https://console.cloud.google.com/billing?hl=es-419&organizationId=0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/judero01col/GMap.NET/issues/51?email_source=notifications&email_token=AMHNNC7U4NNDTEZXZSQDMALQF45O7A5CNFSM4IJFXYLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD463SQQ#issuecomment-524138818, or mute the thread https://github.com/notifications/unsubscribe-auth/AMHNNC542WOODKAZB6UBWNDQF45O7ANCNFSM4IJFXYLA .

judero01col commented 5 years ago

we are here to help