<commit_before>import React              from 'react';
import {Component}        from 'react';
import loadGoogleMapsAPI  from 'load-google-maps-api';

class AmbitMap extends Component {
  constructor(props) {
    super(props);
  }

  // When the component mounts, initialze the map
  componentDidMount() {
    loadGoogleMapsAPI({
      // This is public; restricted by IP
      key: "<KEY>",
      v: '3.25'
    })
    .then((googleMaps) => {
      // when googlMaps is ready pass it to initMap method
      this.initMap(googleMaps);
    });
  }

  // initialize the map with a marker at ambitLocation
  initMap(googleMaps) {
    let selectedAmbit = this.props.ambit;
<commit_msg>(bug)AmbitView - fixed googleMap API error message<commit_after>import React              from 'react';
import {Component}        from 'react';
import loadGoogleMapsAPI  from 'load-google-maps-api';

let loadedGoogleMaps = undefined;

class AmbitMap extends Component {
  constructor(props) {
    super(props);
  }

  // When the component mounts, initialze the map
  componentDidMount() {

    if (loadedGoogleMaps === undefined) {
      loadGoogleMapsAPI({
        // This is public; restricted by IP
        key: "<KEY>",
        v: '3.25'
      })
      .then((googleMaps) => {
        // when googlMaps is ready pass it to initMap method
        loadedGoogleMaps = googleMaps;
        this.initMap(loadedGoogleMaps);
      });
    } else {
        this.initMap(loadedGoogleMaps);
    }
  }

  // initialize the map with a marker at ambitLocation
  initMap(googleMaps) {
    let selectedAmbit = this.props.ambit;

{'fraction_non_alphanumeric': 0.10519724483406387, 'fraction_numerical': 0.003757044458359424, 'mean_word_length': 2.631818181818182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6873879', 'n_tokens_mistral': 488, 'n_tokens_neox': 475, 'n_words': 135}