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;
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
add a comment |
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
add a comment |
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
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
angular ionic-framework google-places-api google-places
asked Mar 25 at 12:04
MatthewDMatthewD
63 bronze badges
63 bronze badges
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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