Adding locations to the ContextHub dropdown | Community
Skip to main content
Level 3
Jun 30, 2017 8:31 AM UTC
Solved

Adding locations to the ContextHub dropdown

Is there a way of adding locations to the contexthub drop down?  For a demo I have temporarily modified /libs/granite/contexthub/components/modules/location/clientlib/renderer.location.js to add a couple of locations in the predefinedLocations array.  However, I would like to have a more suitable solution that does not require making changes to /lib files.

I simply want to add a few more cities that are more local for demonstration purposes.  Any suggestions greatly appreciated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
kautuk_sahni
kautuk_sahniAccepted solution
Employee
Jul 3, 2017 9:19 AM UTC

Yes, you are correct here that we can not overlay clientlibs (Apologizes for that).

But what is happening here is :-

If you are using same category on more then one folder and also using this category name :-

/apps/example/clientlibs[categories="hola"]

/libs/example/clientlibs[categories="hola"]

Then it means that all clientlibs which has this category(for ex:-hola) will be loaded and it just gets stacked onto it.

You can just extending the clientlib, and this is performed just putting in your clientlib the same categories of foundation clientlib.

~kautuk

Kautuk Sahni

3 replies

kautuk_sahni
kautuk_sahniAccepted solution
Employee
Jul 3, 2017 9:19 AM UTC

Yes, you are correct here that we can not overlay clientlibs (Apologizes for that).

But what is happening here is :-

If you are using same category on more then one folder and also using this category name :-

/apps/example/clientlibs[categories="hola"]

/libs/example/clientlibs[categories="hola"]

Then it means that all clientlibs which has this category(for ex:-hola) will be loaded and it just gets stacked onto it.

You can just extending the clientlib, and this is performed just putting in your clientlib the same categories of foundation clientlib.

~kautuk

Translate
Kautuk Sahni
Level 3
Jun 30, 2017 1:12 PM UTC

Thanks - I didn't think you could overlay clientlibs - However I have just tried this and it worked.

Translate
kautuk_sahni
Employee
Jun 30, 2017 9:29 AM UTC

You can extend /libs/granite/contexthub/components/modules/location/clientlib/renderer.location.js file in the apps folder (create a same hierarchy under Apps folder).

Note:- This is edited after Iain's repy. Overlay word is changed to extend.

~kautuk

Translate
Kautuk Sahni