This question about Topic Markup Language and applications: Answered
how to use OpenLayers.js in fowsiki?
I'm trying to include an
OpenLayers map (as per
http://docs.openlayers.org/library/introduction.html#putting-it-all-together) on fowsiki.
I have a topic with:
%ADDTOHEAD{text="<script type=\"text/javascript\" src=\"http://openlayers.org/api/OpenLayers.js\"></script>"}%
<sticky>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(wms);
map.zoomToMaxExtent();
</script></sticky>
but nothing is rendered. Any suggestions welcome!
dave r.
The first thing to do is to put <literal>...</literal> around your script. That will prevent Foswiki trying to render it. The other thing is to debug using firebug in Firefox, and watch to make sure it does something.
--
CrawfordCurrie - 21 Jun 2010
Thanks! After adding the literal tags and a bit of playing, I found that it was just a matter of specifying the size explicitly. Let's see if it works here...
--
DavidRayner - 23 Jun 2010