[OpenLayers-Trac] [OpenLayers] #737: TMS does not use layer name in URL

OpenLayers trac at openlayers.org
Sat Jun 2 15:16:21 EDT 2007


#737: TMS does not use layer name in URL
------------------------+---------------------------------------------------
 Reporter:  openlayers  |       Owner:     
     Type:  feature     |      Status:  new
 Priority:  trivial     |   Milestone:     
Component:  general     |     Version:  SVN
 Keywords:  TMS         |  
------------------------+---------------------------------------------------
 = Problem Description =

 Build a TMS layer in your map, and specify "Ocean Map" as the name
 parameter of the initializer:
 {{{
  var map = new OpenLayers.Map('map');
            map.addControl(new OpenLayers.Control.LayerSwitcher());

            var wms = new OpenLayers.Layer.TMS( "Ocean Map",
                         "/ik/wms/",
                         {'maxExtent': new
 OpenLayers.Bounds(0,0,500,500),'maxResolution': "auto"}
                          );
            map.addLayer(wms);

                 map.zoomToMaxExtent();
  }}}

 Check the URL that the layer specifies for one of its tiles.

 == Expected Behavior ==
 The url (after domain name) of one of the initial four tiles should be,
  {{{
  /ik/wms/1.0.0/Ocean%20Map/0/1.703125/1.3515625.jpg
  }}}

 == Actual Behavior ==
 The url (after domain name) is actually,
  {{{
  /ik/wms/1.0.0/undefined/0/1.703125/0.3515625.jpg
  }}}

 = Planned Solution =
 Now, I'm new to OpenLayers, so perhaps I don't understand the reasoning
 behind the way things are done, but I think that line 78 of
 [http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer/TMS.js
 OpenLayers.Layer.TMS] should use ''this.name'' instead of
 ''this.layername''. A user '''could''' specify 'layername' in the options
 list, but that feels wrong to me, given how I intended to use it.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/737>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list