[OpenLayers-Users] question on OpenLayers and theme urls

Bart van den Eijnden bartvde at osgis.nl
Wed Jun 22 12:42:23 EDT 2011


The recommended way is to construct your Map with theme: null and include the stylesheet yourself in the HTML page.

Bart

Sent from my iPhone

On Jun 22, 2011, at 6:24 PM, Danny Shevitz <shevitz at lanl.gov> wrote:

> Another newbie question here. 
> 
> I am trying to display an OpenLayers map using the Django development server.
> The problem I am running into is that OpenLayers seems to be looking for the
> default theme and image relative the current page url, not OpenLayers itself.
> I am using my own hosted (in OpenLayers).
> 
> My page looks like this (in Firebug):
> 
> <head>
> ...
> <style type="text/css">
> my style stuff ...
> <\style>
> 
> <script src="/static/openlayers.js" type="text/javascript">
> 
> <script type="text/javascript">
> my map script
> </script>
> 
> <link rel="stylesheet" type="text/css" href="theme/default/style.css">
> (*** note I didn't put this like here, Openlayers added it ***)
> 
> </head>
> 
> 
> 
> Now, this code is in a page with url http://localhost:8000/mapping/test/
> These requests are logged by the server:
> 
> [22/Jun/2011 10:19:32] "GET /mapping/test/ HTTP/1.1" 200 1522
> [22/Jun/2011 10:19:32] "GET /static/openlayers.js HTTP/1.1" 200 948380
> [22/Jun/2011 10:19:33] "GET /mapping/test/theme/default/style.css HTTP/1.1" 200
> 1522
> [22/Jun/2011 10:19:33] "GET /mapping/test/img/north-mini.png HTTP/1.1" 200 1522
> [22/Jun/2011 10:19:33] "GET /mapping/test/img/west-mini.png HTTP/1.1" 200 1522
> [22/Jun/2011 10:19:33] "GET /mapping/test/img/east-mini.png HTTP/1.1" 200 1522
> [22/Jun/2011 10:19:33] "GET /mapping/test/img/south-mini.png HTTP/1.1" 200 1522
> [22/Jun/2011 10:19:33] "GET /mapping/test/img/zoom-plus-mini.png HTTP/1.1" 200 1
> 522
> [22/Jun/2011 10:19:33] "GET /mapping/test/img/zoom-world-mini.png HTTP/1.1" 200
> 1522
> [22/Jun/2011 10:19:33] "GET /mapping/test/img/zoom-minus-mini.png HTTP/1.1" 200
> 1522
> 
> notice that I am running the page /mapping/test/ (correct)
> including my hosted /static/openlayers.js/ (correct)
> 
> but then things get strange, all the following urls are of the form
> /mapping/test/..., but should be of the form:
> /static/...
> 
> Can anyone please explain what is going on, or how to have OpenLayers find it's
> static content?
> 
> thanks,
> Danny
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 


More information about the Users mailing list