Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am customizing the opentripplanner webapp according to my needs. it has 5 different base layers. but in code (in map.js and OpenLayersUtils) i can't find where it adds these layers to map.

share|improve this question
up vote 1 down vote accepted

Try the source directly from the git repo here of opentripplanner. I think it's somewhere in this file where they setup the map.

There you see:

 initialize : function(config)
    otp.configure(this, config); = otp.util.OpenLayersUtils.makeMap(this.mapDiv, this.options);
    if (this.baseLayer == null)
        this.baseLayer = otp.util.OpenLayersUtils.makeMapBaseLayer(, this.baseLayerOptions);
        this.cartoLayer = this.baseLayer;
        this.orthoLayer = this.baseLayer;
        this.cartoLayer =[0];
        this.orthoLayer =[1];

        if(this.baseLayer.length > 1 && this.plannerOptions && this.plannerOptions.showLayerSwitcher !== false) {
        } else {
    }, true);

In there is a line:

otp.configure(this, config);

That looks like a variable thing, a bit below that you see that this otp config object if exists is being used to set up layers;

Looking at the rest of the code, it looks like you have 3 basic layers: WMS + the carto + ortho layer. The other 2 come from something dynamically configured it seems. That would be my first guess. The WMS layer is defined in makeMap, in this file

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.