Difference between revisions of "Widget:OSM-Sudoroom-dev"

From Sudo Room
Jump to navigation Jump to search
(fix use of lonlat variable)
(pass width & height units)
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
This is a homebrew attempt at making an OSM widget in mediawiki, fancier than the official extension will allow.
This is a homebrew attempt at making an OSM widget in mediawiki, fancier than the official extension will allow.
</noinclude><includeonly>
</noinclude><includeonly>
   <div style="width:<!--{$w|escape:'html'|default:425}-->px;height:<!--{$h|escape:'html'|default:350}-->px;border:1px solid black;margin:0px;" id="mapdiv"></div>
   <div style="width:<!--{$w|escape:'html'|default:425}-->;height:<!--{$h|escape:'html'|default:350}-->;border:1px solid black;margin:0px;" id="mapdiv"></div>
   <script src="https://sudoroom.org/openlayers/OpenLayers.js"></script>
   <script src="https://sudoroom.org/openlayers/OpenLayers.js"></script>
   <script>
   <script>
Line 15: Line 15:
           );
           );
   
   
     var zoom=17;
     var zoom=14;
   
   
     var markers = new OpenLayers.Layer.Markers( "Markers" );
     var markers = new OpenLayers.Layer.Markers( "Markers" );
Line 24: Line 24:
     map.setCenter (lonLat, zoom);
     map.setCenter (lonLat, zoom);


     map.addPopup(new OpenLayers.Popup.FramedCloud("Popup",  
     map.addPopup(new OpenLayers.Popup.FramedCloud("Popup",lonLat, null,
        lonLat, null,'<!--{$text|escape:'html'|default:markertext}-->', null,true
      '<!--{$text1|escape:'html'|default:markertext}-->&nbsp;&nbsp;&nbsp;<br /><br />' +
      '<!--{$text2|escape:'html'|default:markertext}-->' +
      '<br /><hr style="color:#f0f0e7;background-color:#f0f0e7;" />' +
      '<!--{$address|escape:'html'|default:markertext}--> ' +
      '(<a href="<!--{$link|escape:'html'|default:markertext}-->">Directions</a>)', null,true
     ));
     ));
   </script>
   </script>
</includeonly>
</includeonly>

Latest revision as of 21:23, 3 March 2014

This is a homebrew attempt at making an OSM widget in mediawiki, fancier than the official extension will allow.