15

I am trying to use google maps distance matrix api in my project to get distance between 2 places. I have also enable this api in google developer console. But I am continuously getting error ApiNotActivatedMapError.

I am using sample code provided by google as distance-matrix .

Abhinav Singh Maurya
  • 3,313
  • 8
  • 33
  • 51
abrar syed
  • 307
  • 1
  • 3
  • 7

3 Answers3

33

When you use a library or service via the Maps-Javascript-API, and use a key, you only need to activate the Google Maps JavaScript API .

When you get the particular error with the linked example you obviously didn't activate the Google Maps JavaScript API for your project.

Update:

since June 22, 2016 you need also to activate the related API(Webservice) for new applications when you want to use the following features:

  • geocoding service
  • directions service
  • distanceMatrix service
  • elevation service
  • places library
Community
  • 1
  • 1
Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • 9
    But HOW do you activate it? – Konerak Feb 03 '17 at 10:37
  • 1
    @Konerak https://developers.google.com/maps/documentation/javascript/get-api-key – Dr.Molle Feb 05 '17 at 01:42
  • 3
    Yeah, that's how you get one. After you get one, you need to select it and walk through a maze of clicks and options to then find a page with all products. You click on the products one by one and activate each one on their seperate page. Was a bit of a search for me :) – Konerak Feb 05 '17 at 12:11
  • Does it take a while to update? because im all activated, with a billing account. and i still get the error – Sweet Chilly Philly Sep 30 '19 at 02:40
9

Old question.. But.. I had n similar issue recently with a ApiNotActivatedMapError using geocoding but Konerak's comment helped me get to this really nice post.

Basically, you can activate your API's here: https://console.developers.google.com/apis/library

Activating Google Maps JavaScript API along with the already activate Geocoding API solved my problem.

Hope it helps someone in a similar position :)

Xylo
  • 91
  • 1
  • 1
0

This link is enabled API https://console.developers.google.com/apis/library. For default emulator and in iOS its disabled, but in this console you can active this API.

syam
  • 799
  • 1
  • 12
  • 30
Jhonk
  • 1