{"action":"created","issue":{"url":"https://api.github.com/repos/ng2-ui/map/issues/271","repository_url":"https://api.github.com/repos/ng2-ui/map","labels_url":"https://api.github.com/repos/ng2-ui/map/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/ng2-ui/map/issues/271/comments","events_url":"https://api.github.com/repos/ng2-ui/map/issues/271/events","html_url":"https://github.com/ng2-ui/map/issues/271","id":330787826,"node_id":"MDU6SXNzdWUzMzA3ODc4MjY=","number":271,"title":"Question: how to set apiUrl after module init","user":{"login":"mbenedettini","id":647206,"node_id":"MDQ6VXNlcjY0NzIwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/647206?v=4","gravatar_id":"","url":"https://api.github.com/users/mbenedettini","html_url":"https://github.com/mbenedettini","followers_url":"https://api.github.com/users/mbenedettini/followers","following_url":"https://api.github.com/users/mbenedettini/following{/other_user}","gists_url":"https://api.github.com/users/mbenedettini/gists{/gist_id}","starred_url":"https://api.github.com/users/mbenedettini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbenedettini/subscriptions","organizations_url":"https://api.github.com/users/mbenedettini/orgs","repos_url":"https://api.github.com/users/mbenedettini/repos","events_url":"https://api.github.com/users/mbenedettini/events{/privacy}","received_events_url":"https://api.github.com/users/mbenedettini/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-06-08T20:09:32Z","updated_at":"2018-10-14T23:06:44Z","closed_at":"2018-06-09T18:48:56Z","author_association":"NONE","body":"I'm retrieving my Google Maps key from server side (using a service), so I cannot call `NguiMapModule.forRoot()` with the right apiUrl from within my module imports. \r\n\r\nHow can that be accomplished? Something similar was asked in this issue https://github.com/ng2-ui/map/issues/242 where user wants to change the language but I cannot figure out how to set apiUrl once the module has been initialized.\r\n\r\nTo sum it up, I'd like to set apiUrl from within my component constructor.\r\n\r\nCould you guys point me in the right direction?\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/ng2-ui/map/issues/comments/429671145","html_url":"https://github.com/ng2-ui/map/issues/271#issuecomment-429671145","issue_url":"https://api.github.com/repos/ng2-ui/map/issues/271","id":429671145,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTY3MTE0NQ==","user":{"login":"inzi","id":889113,"node_id":"MDQ6VXNlcjg4OTExMw==","avatar_url":"https://avatars1.githubusercontent.com/u/889113?v=4","gravatar_id":"","url":"https://api.github.com/users/inzi","html_url":"https://github.com/inzi","followers_url":"https://api.github.com/users/inzi/followers","following_url":"https://api.github.com/users/inzi/following{/other_user}","gists_url":"https://api.github.com/users/inzi/gists{/gist_id}","starred_url":"https://api.github.com/users/inzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inzi/subscriptions","organizations_url":"https://api.github.com/users/inzi/orgs","repos_url":"https://api.github.com/users/inzi/repos","events_url":"https://api.github.com/users/inzi/events{/privacy}","received_events_url":"https://api.github.com/users/inzi/received_events","type":"User","site_admin":false},"created_at":"2018-10-14T23:06:44Z","updated_at":"2018-10-14T23:06:44Z","author_association":"NONE","body":"Agreed.\r\n\r\nI was able to get it to work! Thank you for your tips. They put me on the right path.\r\n\r\nI created the service the same as you - for anyone else that's a total n00b like me:\r\n\r\nIn your main app module, you still need to pull in NguiMapModule.\r\nLike so:\r\n    NguiMapModule.forRoot({ apiUrl: 'https://maps.google.com/maps/api/js?key=&libraries=visualization,places,drawing' }),\r\n\r\nNot I just left the key out.\r\n\r\nIn your main app module, add the provider above.\r\n\r\nAfter you bootstrap your app and get your API key, on the component for your page, you inject it there, and set the URL in the constructor. \r\n\r\nIn my case, I did a normal bootstrap to pull down a JSON string and set it to a constants service.\r\n\r\nThen, I referenced the constants service, which constructed my api url, and set it.\r\nLike so:\r\n\r\n  constructor(\r\n    injector: Injector,\r\n    private _MapLoader: MyNgMapApiLoader,\r\n    private ref: ChangeDetectorRef\r\n  ) {\r\n    super(injector);\r\n    this._MapLoader.changeUrl(AppConsts.googleMapsURL());\r\n  }\r\n\r\n\r\n"}}
{"actor":{"display_login":"inzi"}}