How to configure leaflet client

345 views
Skip to first unread message

Mark_Lester

unread,
Dec 4, 2013, 2:51:12 AM12/4/13
to opentrippl...@googlegroups.com
editing ./otp-leaflet-client/src/main/webapp/js/otp/config.js causes changes on the UI, so it seems I have been running the leaflet client all along.
I am no nearer to making the startName endName dialogue appear. i.e I want to type in dhaka and chittagong and get the trains.

Stefan Steiniger

unread,
Dec 4, 2013, 11:59:13 AM12/4/13
to opentrippl...@googlegroups.com
maybe a dumb questions, but:
are you sure the leaflet client provides such boxes/fields?
I know the old client has them, but I have never seen a leaflet client
with it. Only with dragable markers.

I may be wrong though

stefan

Am 04.12.13 04:51, schrieb Mark_Lester:
> --
> You received this message because you are subscribed to the Google
> Groups "OpenTripPlanner Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to opentripplanner-...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Mark_Lester

unread,
Dec 4, 2013, 12:51:41 PM12/4/13
to opentrippl...@googlegroups.com
Hello Stefan.
Well, I was assuming it did, but out of the box as you say, it's just via the map. This is obviously important functionality especially if the user has little or no understanding of the geography in question.
I appreciate there's been a pretty fundamental re-org recently and the config.js set up has changed. I do need this back though.

Mark_Lester

unread,
Dec 4, 2013, 1:24:29 PM12/4/13
to opentrippl...@googlegroups.com
I think I need to define a geocoder.

otp/modules/multimodal/MultimodalPlannerModule.js

        if(this.webapp.geocoders && this.webapp.geocoders.length > 0) {
            this.optionsWidget.addControl("locations", new otp.widgets.tripoptions.LocationsSelector(this.optionsWidget, this.webapp.geocoders), true);
            this.optionsWidget.addVerticalSpace(12, true);
        }
';
I was assuming it just worked on the input set of names from the GTFS stops file. In fact that's how I'd like it to work. But this looks promising, I will report back.

Mark_Lester

unread,
Dec 4, 2013, 2:13:44 PM12/4/13
to opentrippl...@googlegroups.com
the instructions are all regarding the re-org with new config stuff.e.g.  https://groups.google.com/forum/#!topic/opentripplanner-dev/81RfyaCpy1A
All I've managed to do so far is get the planner dialog to vanish by sticking (I presume) invalid values into the geocoders array in the new config.js

   geocoders : [
        {
            name : 'geocoderNominatim',
            className : 'org.opentripplanner.geocoder.nominatim.NominatimGeocoder',
            url : 'http://open.mapquestapi.com/nominatim/v1/search',
        },
    ],
 

Andrew Byrd

unread,
Dec 4, 2013, 2:31:39 PM12/4/13
to opentrippl...@googlegroups.com
On 12/04/2013 07:24 PM, Mark_Lester wrote:
> I think I need to define a geocoder.
[...]
> I was assuming it just worked on the input set of names from the GTFS
> stops file. In fact that's how I'd like it to work. But this looks
> promising, I will report back.

Correct. The OTP API does not accept the names of the stops from the
GTFS feed as search endpoints, and yes, you need a geocoder as explained
in this reply:
https://groups.google.com/d/msg/opentripplanner-users/w8njlQVEOfE/QUpXX8uhPgMJ

We would of course like to get this resolved and ensure that we have
proper instructions for configuring a geocoder on the wiki, but before
you send a message to this mailing list please consider that it will be
copied to almost 300 people. It is not necessarily productive to report
each step in your deployment to all the users of OTP.

-Andrew

Mark_Lester

unread,
Dec 4, 2013, 4:13:13 PM12/4/13
to opentrippl...@googlegroups.com
config.js has changed. as has the whole directory structure. the instructions here, https://groups.google.com/forum/#!msg/opentripplanner-dev/81RfyaCpy1A/0RF_iIG8IuUJ, dont work.
I'll try and cut the spam down but all I am trying to do is work out how to deploy a standard system.

Mark_Lester

unread,
Dec 5, 2013, 6:27:32 PM12/5/13
to opentrippl...@googlegroups.com
The only otp-leaflet-client/src/main/webapp/js/otp/config.js values I can get to work are these

geocoders : [
        {
            name : 'TriMet Default',
            className : 'otp.core.Geocoder',
            url : 'http://maps5.trimet.org/geocoder/geocode',
            addressParam : 'address'
        },
of course I need bangladesh mainline, not portland district.
I've built a little geocoder server that reads in stops.txt and returns any matching stations to queries. I am trying to work out what it's not doing that map5.trimet.org does.

I would just like to verify that knocking up your own geocoder is an exercise for the user (if you want to restrict the match just to stations you run trains from).

Andrew Byrd

unread,
Dec 7, 2013, 9:03:41 AM12/7/13
to opentrippl...@googlegroups.com
On 12/06/2013 12:27 AM, Mark_Lester wrote:
> I would just like to verify that knocking up your own geocoder is an
> exercise for the user (if you want to restrict the match just to
> stations you run trains from).

Correct, simply because this is an open source project no one has
contributed such functionality yet. We're always open to patches and
pull requests.

-Andrew

Andrew Byrd

unread,
Dec 7, 2013, 9:54:18 AM12/7/13
to opentrippl...@googlegroups.com
Correct, module names and the whole directory layout have changed. This
is explained on the wiki landing page:
https://github.com/opentripplanner/OpenTripPlanner/wiki#code-repository

We had too many modules and a complicated layout, which we have
simplified. Please bear with us as we restructure everything.

Most documentation refers to the old layout in the 'stable' branch. This
is the layout in release versions of OTP. The 'master' branch of the
repository is the version under active development and is not released yet.

-Andrew

Mark_Lester

unread,
Dec 7, 2013, 10:32:44 AM12/7/13
to opentrippl...@googlegroups.com
I've got a short perl program for the geocode server. The user has to supply the stops,txt file. I will try and work out how to implement within otp as a sub project in java. It may be better to read the stops data from Graph.obj, but my main issue will be just to work out how I add a project/service and fit in without it being more trouble for everyone than it's worth. So I'll leave it for a while.
Anyone is welcome to my perl program https://github.com/mark-lester/otp-geocode-server/
The simple functionality of using the stops table to define a geocoder lookup would obviously be very handy as an option.


Reply all
Reply to author
Forward
0 new messages