Commits

Igor Támara committed 6e8981a

Removed osmarender due to openstreetmap decision and pointed openlayers to 2.10 api

  • Participants
  • Parent commits 244f469

Comments (0)

Files changed (2)

 var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
       displayOutsideMaxExtent: true,
       wrapDateLine: true});
-var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {
-      displayOutsideMaxExtent: true,
-      wrapDateLine: true});
 var cyclemap = new OpenLayers.Layer.OSM.CycleMap("Cycle Map", {
       displayOutsideMaxExtent: true,
       wrapDateLine: true});
        displayProjection: epsg4326
    });
    map.addLayer(mapnik);
-   map.addLayer(osmarender);
    map.addLayer(cyclemap);
    marker_layer = new OpenLayers.Layer.Markers("Markers", {
        displayInLayerSwitcher: false,
        displayProjection: epsg4326
    });
    map.addLayer(mapnik);
-   map.addLayer(osmarender);
    map.addLayer(cyclemap);
    marker_layer = new OpenLayers.Layer.Markers("Markers", {
        displayInLayerSwitcher: false,

File macro/OSM.py

 
 #This is a moinmoin plugin : It projects data from OSM through
 #OpenLayers to your moinmoin instance.
-#
+#Please do note that at the moment, there is a javascript function
+#at http://static.slec.net/slecstats/js/map.js
+#if the load increases a lot, we will be moving the js to another
+#place.
 #
 #= Parameter description =
-#<<OSM(4.65514589,-74.109660387,13,http://www.gfc.edu.co/images/marker.png,200,350)>>
+#[[OSM(4.65514589,-74.109660387,13,http://www.gfc.edu.co/images/marker.png,200,350)]]
 #Will project an OSM map using OpenLayers centered at lan,lot (4.65514589,-74.109660387)
 #with 13 zoom a marker provided by http://www.gfc.edu.co/images/marker.png on a
 #200px width 350 height map.
     if len(spl)<2:
     	return "Indique latitud y longitud como mínimo"
     mydict=parseargs(spl)
-    return """<div style="width: %(width)spx; height: %(height)spx;"  id="map"></div>
-  <script src="http://www.openlayers.org/api/2.11/OpenLayers.js"></script>
-  <script>
-    map = new OpenLayers.Map("map");
-    map.addLayer(new OpenLayers.Layer.OSM());
- 
-    var lonLat = new OpenLayers.LonLat( %(lon)s ,%(lat)s )
-          .transform(
-            new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
-            map.getProjectionObject() // to Spherical Mercator Projection
-          );
- 
-    var zoom=%(zoom)s;
-    var size = new OpenLayers.Size(21,25);
-    var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
-    var markers = new OpenLayers.Layer.Markers( "Markers" );
-    map.addLayer(markers);
- 
-    markers.addMarker(new OpenLayers.Marker(lonLat,new OpenLayers.Icon('%(marker)s',size,offset)));
- 
-    map.setCenter (lonLat, zoom);
-  </script>
-"""  % mydict
+    return """<script
+    src="http://static.slec.net/slecstats/js/jquery-latest.min.js"
+    type="text/javascript"></script><script
+    src="http://openlayers.org/api/2.10/OpenLayers.js"
+    type="text/javascript"></script><script
+    src="http://openstreetmap.org/openlayers/OpenStreetMap.js"
+    type="text/javascript"></script><script
+    src="http://static.slec.net/slecstats/js/map.js"
+    type="text/javascript"></script><script type="text/javascript">
+    jQuery(document).ready(function () {
+       var d= Array();
+       d[0]={'lat':%(lat)s,'lon':%(lon)s};
+       var map = my_map('map',d,'%(marker)s',%(zoom)s);
+    });
+
+</script>
+   <div style="width: %(width)spx; height: %(height)spx;" id="map"></div>
+   """  % mydict