How to dynamically load the Google Places API Javascript Library with varying API keys into an Ionic appdifference between a nearby search and a text search in Google Places APIGoogle Places Library vs Google Places APIPlace from Google Maps missing in Google Places APIAPI key with Google Maps JavaScript API LibraryGoogle Places API no Longer Returns Picture Links for Radius Searches, Only RankBy Distance?Google places API not returning address componentsGoogle Place Photo API returning 404Google places, with different api keys getting “You have exceeded your daily request quota for this API.”Is there a free places auto complete api or libraryHow to use rankby with type and radius in google place API

Can a US President have someone sent to prison?

Wilcoxon signed rank test – critical value for n>50

Are there any vegetarian astronauts?

Procedurally generate regions on island

Is there any set of 2-6 notes that doesn't have a chord name?

How hard is it to sell a home which is currently mortgaged?

What does 2>&1 | tee mean?

What is the line crossing the Pacific Ocean that is shown on maps?

Cross over of arrows in a complex diagram

Difference between 'demás' and 'otros'?

Do 3D printers really reach 50 micron (0.050mm) accuracy?

Why is a blank required between "[[" and "-e xxx" in ksh?

How fast can a ship with rotating habitats be accelerated?

A player is constantly pestering me about rules, what do I do as a DM?

I played my first (rapid) tournament recently and I wanted to calculate my ELO

What speedlites can work with the Canon EOS 4000D's non-standard hotshoe?

How exactly is a normal force exerted, at the molecular level?

In native German words, is Q always followed by U, as in English?

Why is the divergence of this series apparently not predicted by the Monotonic Sequence Theorem?

Compute unstable integral with high precision

Zombie diet, why humans?

Generate and graph the Recamán Sequence

What shortcut does ⌦ symbol in Camunda macOS app indicate and how to invoke it?

Anagram Within an Anagram!



How to dynamically load the Google Places API Javascript Library with varying API keys into an Ionic app


difference between a nearby search and a text search in Google Places APIGoogle Places Library vs Google Places APIPlace from Google Maps missing in Google Places APIAPI key with Google Maps JavaScript API LibraryGoogle Places API no Longer Returns Picture Links for Radius Searches, Only RankBy Distance?Google places API not returning address componentsGoogle Place Photo API returning 404Google places, with different api keys getting “You have exceeded your daily request quota for this API.”Is there a free places auto complete api or libraryHow to use rankby with type and radius in google place API






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am developing an app using the Ionic Framework (Ionic 3) where my users that are associated with different organisations can enter data (the relevant data in this case is a city name) and I use the Google Places API to retrieve photos of these cities.



Until a few months ago I was using the API calls outlined here without issue.



However, now the requests no longer return photos and I am receiving errors related to CORB (Cross Origin Resource Blocking) and I am no longer able to use the API calls within my app.



According to the Google Maps documentation, I am required to load the Google Maps javascript library within my HTML.




Loading the library
The Places service is a self-contained library, separate from the main Maps JavaScript API code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL:



<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>




I am not completely how to sure how to do this in ionic/angular.



I think I could just insert this on the index.html page, however my issue is that the API key in the link needs to be changed dynamically. A different Google Places API key will be used depending on which organisation the user belongs to. How am I able to dynamically use this library within ionic and dynamically change the API key? It is possible that the used key will need to be changed during the same login session (in the case that a user belongs to multiple organisations and is logging different data as a part of each organisation)










share|improve this question




























    0















    I am developing an app using the Ionic Framework (Ionic 3) where my users that are associated with different organisations can enter data (the relevant data in this case is a city name) and I use the Google Places API to retrieve photos of these cities.



    Until a few months ago I was using the API calls outlined here without issue.



    However, now the requests no longer return photos and I am receiving errors related to CORB (Cross Origin Resource Blocking) and I am no longer able to use the API calls within my app.



    According to the Google Maps documentation, I am required to load the Google Maps javascript library within my HTML.




    Loading the library
    The Places service is a self-contained library, separate from the main Maps JavaScript API code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL:



    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>




    I am not completely how to sure how to do this in ionic/angular.



    I think I could just insert this on the index.html page, however my issue is that the API key in the link needs to be changed dynamically. A different Google Places API key will be used depending on which organisation the user belongs to. How am I able to dynamically use this library within ionic and dynamically change the API key? It is possible that the used key will need to be changed during the same login session (in the case that a user belongs to multiple organisations and is logging different data as a part of each organisation)










    share|improve this question
























      0












      0








      0








      I am developing an app using the Ionic Framework (Ionic 3) where my users that are associated with different organisations can enter data (the relevant data in this case is a city name) and I use the Google Places API to retrieve photos of these cities.



      Until a few months ago I was using the API calls outlined here without issue.



      However, now the requests no longer return photos and I am receiving errors related to CORB (Cross Origin Resource Blocking) and I am no longer able to use the API calls within my app.



      According to the Google Maps documentation, I am required to load the Google Maps javascript library within my HTML.




      Loading the library
      The Places service is a self-contained library, separate from the main Maps JavaScript API code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL:



      <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>




      I am not completely how to sure how to do this in ionic/angular.



      I think I could just insert this on the index.html page, however my issue is that the API key in the link needs to be changed dynamically. A different Google Places API key will be used depending on which organisation the user belongs to. How am I able to dynamically use this library within ionic and dynamically change the API key? It is possible that the used key will need to be changed during the same login session (in the case that a user belongs to multiple organisations and is logging different data as a part of each organisation)










      share|improve this question














      I am developing an app using the Ionic Framework (Ionic 3) where my users that are associated with different organisations can enter data (the relevant data in this case is a city name) and I use the Google Places API to retrieve photos of these cities.



      Until a few months ago I was using the API calls outlined here without issue.



      However, now the requests no longer return photos and I am receiving errors related to CORB (Cross Origin Resource Blocking) and I am no longer able to use the API calls within my app.



      According to the Google Maps documentation, I am required to load the Google Maps javascript library within my HTML.




      Loading the library
      The Places service is a self-contained library, separate from the main Maps JavaScript API code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL:



      <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>




      I am not completely how to sure how to do this in ionic/angular.



      I think I could just insert this on the index.html page, however my issue is that the API key in the link needs to be changed dynamically. A different Google Places API key will be used depending on which organisation the user belongs to. How am I able to dynamically use this library within ionic and dynamically change the API key? It is possible that the used key will need to be changed during the same login session (in the case that a user belongs to multiple organisations and is logging different data as a part of each organisation)







      angular ionic-framework google-places-api google-places






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 12:04









      MatthewDMatthewD

      63 bronze badges




      63 bronze badges






















          0






          active

          oldest

          votes














          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337411%2fhow-to-dynamically-load-the-google-places-api-javascript-library-with-varying-ap%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337411%2fhow-to-dynamically-load-the-google-places-api-javascript-library-with-varying-ap%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?