Google maps API key for quickstart bundle

36 views
Skip to first unread message

Nicolas Derive

unread,
Jun 24, 2017, 4:52:07 AM6/24/17
to onebusaw...@googlegroups.com
Dear all,

I had a look at the docs but that's not clear for me if I have to rebuild OBA to specify a Google maps API key or if I can add it to some config file to use it with quickstart bundle.

Could you help me on this?

Thanks for your help.


Nicolas

Sheldon A. Brown

unread,
Jun 26, 2017, 6:42:47 AM6/26/17
to onebusaw...@googlegroups.com
Its in the spring configuration:
https://github.com/camsys/onebusaway-application-modules/blob/unified/onebusaway-presentation/src/main/java/org/onebusaway/presentation/impl/configuration/DefaultWebappConfigurationSource.java#L61

So adding something like this to your data-sources.xml should work.

<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
<property name="properties">
<props>
<prop
key="defaultWebappConfigurationSource.googleMapsApiKey">myKey</prop>
</props>
</property>
</bean>

I haven't tested this -- so please try it out and let me know if it works.

Sheldon
> --
> You received this message because you are subscribed to the Google Groups
> "onebusaway-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to onebusaway-use...@googlegroups.com.
> To post to this group, send email to onebusaw...@googlegroups.com.
> Visit this group at https://groups.google.com/group/onebusaway-users.
> For more options, visit https://groups.google.com/d/optout.

e...@trilliumtransit.com

unread,
Jun 26, 2017, 6:45:46 PM6/26/17
to onebusaway-users
Just did this, in my case I ended up additionally needing to set it in a number of other html files, using this perl script "greplace.pl". Make sure to create a backup of your files before doing this, or any other bulk-edit operation.

grep -R -l ABQIAAAA1R onebusaway-* |
xargs ./greplace.pl ABQIAAAA1R_R0bUhLYRwbQFpKHVowhR6ggDNEO1rwvdlk5egWeAHsl3o5xT2ki4Fn-LXLHIrJfb8VmKQeIMh5g {your_new_google_maps_api_key}


#!/usr/bin/env perl
# use: greplace.pl from_key to_key file1 file2 .... fileN
$from = shift @ARGV;
$to   = shift @ARGV;
print "Replacing all occurances of $from with $to for files @ARGV\n";
$^I = '.bak';  # Call for in-place editing; make backups with a .bak suffix
while (<>) {
  s/$from/$to/;
  print;

Nicolas Derive

unread,
Jun 27, 2017, 4:07:22 AM6/27/17
to onebusaw...@googlegroups.com
Dear Sheldon and Ed,

Thanks for your help. 

I did the change indicated by Sheldon but that didn't completely fixed my problem. Doing also the changes suggested by Ed completely fixed it.


Thanks again!

Nicolas

To unsubscribe from this group and stop receiving emails from it, send an email to onebusaway-users+unsubscribe@googlegroups.com.
To post to this group, send email to onebusaway-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages