Notifications
Clear all

How do I insert an External Reference for the Google Maps API?

4 Posts
3 Users
0 Reactions
1,049 Views
0
Topic starter

When I look at a map in my instance, there are watermarks from Google Maps on top of map. How do I get rid of those watermarks?

2 Answers
0
Topic starter

Google Maps API keys are stored as an External Reference, which is a value saved in the app's database.

See the documentation here for notes about External References: https://devnet.onenetwork.com/oms/apps/DeveloperNetwork/www/docs/guides/SdkUsersGuide/help/index.html#external-ref-system-config

Here are the steps to add an External Reference for the Google Maps API Key:

First, connect to the database. You can do this using a GUI tool like SQL Developer or DBeaver. You can also do this from the command line using "sqlplus". Note, this will require you to know the username, password, and address (if not local) of the database.

Second, prepare your SQL command. The following is an example of a SQL Insert command to create a new External Reference database record.
Replace "1234" with your app's Value Chain ID number.
Replace "GeoGraphApiKey" with the appropriate value found in the table linked above.
Replace "myAPIKeyFromGoogle" with the actual API key. See this URL for One Network API keys: https://portal.onenetwork.com/display/NI/Google+Play+Account+for+Google+Map+Development
Replace "myInstanceName" with the appropriate value for your instance.

insert into EXTERNAL_REFERENCE (
  SYS_EXTERNAL_REFERENCE_ID,
  MODEL_NAME,
  CREATION_USER, CREATION_DATE, LAST_MODIFIED_USER, LAST_MODIFIED_DATE, LEVEL_MODIFIED_DATE,
  VC_ID, REF_TYPE, EXTERNAL_VALUE, LOCAL_VALUE) values (
  EXTERNAL_REFERENCE_seq.nextval,
  'Standard ExternalReference', 'InstanceAdminUser', systimestamp, 'InstanceAdminUser',systimestamp, systimestamp,
  1234, 'GeoGraphApiKey', 'myAPIKeyFromGoogle', 'myInstanceName');

Third, run your SQL command. This will insert the record into the database.

Finally, verify that the API was added properly. For the Google Maps API key, you should be able to reload the app to see it take effect. Using your database connection, you could also run a SQL query like the following to verify that the value was inserted into the database:

select * from EXTERNAL_REFERENCE where REF_TYPE = 'GeoGraphApiKey';
0

There's also a way to manage external references via the UI. You can add the following WebAction to a VC Admin user for a report that will list all external references, as well as provide a button to create new ones in the DB:

<WebAction name="ExternalReference">
  <PanelOptions>
    <PanelClass>One.Report</PanelClass>
    <PanelConfig><![CDATA[{reportName: 'PLT.ExternalReference', autoExecute: true}]]></PanelConfig>
  </PanelOptions>
</WebAction>

Or you can open the report directly in the browser's dev tools by executing:

Desktop.openPanelInNewTab('One.Report', { reportName: 'PLT.ExternalReference', autoExecute: true }, 'External References');
Matt Nutsch Topic starter 2020-02-18 08:02:00

Thanks for mentioning this Sean!

Piyush Patil 2020-02-19 01:02:00

You can also use PLT.ExternalReference_IB (1.0) to load external references to the server.