Initialisation sur une base a peu pret fonctionnelle
authorheureuxcyclage <heureuxcyclage@slave1.vds.lautre.net>
Wed, 23 Nov 2011 14:45:11 +0000 (15:45 +0100)
committerheureuxcyclage <heureuxcyclage@slave1.vds.lautre.net>
Wed, 23 Nov 2011 14:45:11 +0000 (15:45 +0100)
13 files changed:
carte_de_sites_pipelines.php [new file with mode: 0644]
contenu/page-carte_de_sites.html [new file with mode: 0644]
contenu/page-carte_de_sites.html~ [new file with mode: 0644]
images/blue.png [new file with mode: 0644]
images/green.png [new file with mode: 0644]
images/grey.png [new file with mode: 0644]
images/orange.png [new file with mode: 0644]
images/ptitvelo.png [new file with mode: 0755]
images/red.png [new file with mode: 0644]
images/workshop.xcf [new file with mode: 0644]
images/yellow.png [new file with mode: 0644]
plugin.xml [new file with mode: 0644]
test.html [new file with mode: 0644]

diff --git a/carte_de_sites_pipelines.php b/carte_de_sites_pipelines.php
new file mode 100644 (file)
index 0000000..3d2b3b4
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+function carte_de_sites_insert_head($flux){
+       $flux .= "<link rel='stylesheet' href='".url_de_base()."lib/CloudMade-Leaflet-404b097/dist/leaflet.css' />"."\n";
+       $flux .= "<!--[if lte IE 8]><link rel='stylesheet' href='".url_de_base()."lib/CloudMade-Leaflet-404b097/dist/leaflet.ie.css' /><![endif]-->\n"."\n\n";
+       return $flux;
+}
+?>
\ No newline at end of file
diff --git a/contenu/page-carte_de_sites.html b/contenu/page-carte_de_sites.html
new file mode 100644 (file)
index 0000000..2ec7ab6
--- /dev/null
@@ -0,0 +1,60 @@
+<div id="map" style="width: 540px; height: 400px"></div>
+
+
+<strong>Legende</strong><br/>
+       <BOUCLE_legende(MOTS){type = Ateliers}{!par id_mot}>
+               <p>#LOGO_MOT #TITRE</p>
+       </BOUCLE_legende>
+
+
+<script src="#CONFIG{adresse_site}/lib/CloudMade-Leaflet-404b097/dist/leaflet.js"></script>
+<script>
+       var map = new L.Map('map');
+       
+       var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
+               cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
+               cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
+       
+       map.setView(new L.LatLng(46.8, 2.52), 5).addLayer(cloudmade);
+  
+       var WorkshopIcon = L.Icon.extend({
+           iconUrl: '#CONFIG{adresse_site}/plugins/carte-de-sites/images/grey.png',
+           shadowUrl: '#CONFIG{adresse_site}/lib/CloudMade-Leaflet-404b097/dist/images/marker-shadow.png',
+           iconSize: new L.Point(25, 41),
+           shadowSize: new L.Point(41, 41),
+           iconAnchor: new L.Point(13, 41),
+           popupAnchor: new L.Point(0, -33)
+       });             
+       
+       var     greyIcon = new WorkshopIcon()
+                       redIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/red.png'),
+                       yellowIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/yellow.png'),
+                       blueIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/blue.png'),
+                       greenIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/green.png');
+       
+
+       <BOUCLE_ateliers_types(MOTS){type = Ateliers}{!par id_mot}>
+                       <BOUCLE_sites(SITES){id_mot}>
+                                       <BOUCLE_coord(GIS){id_syndic}>
+                                                       siteIcon = new WorkshopIcon('#CONFIG{adresse_site}/IMG/[(#LOGO_MOT|fichier)]')
+                                                       var markerGrenoble = new L.Marker(new L.LatLng(#LAT, #LON), {icon: siteIcon});
+                                                       map.addLayer(markerGrenoble);
+                                                       markerGrenoble.bindPopup("<a href='#URL_SITE'>#NOM_SITE</a><br/>#_sites:DESCRIPTIF<br/>#ADRESSE<br/> #CODE_POSTAL #VILLE<br/><br/><em>Statut: #_ateliers_types:TITRE</em>");
+                                       </BOUCLE_coord>
+                       </BOUCLE_sites>
+       </BOUCLE_ateliers_types>
+       
+                       
+       map.on('click', onMapClick);
+       
+       var popup = new L.Popup();
+
+             function onMapClick(e) {
+                     var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
+
+                     popup.setLatLng(e.latlng);
+                     popup.setContent("You clicked the map at " + latlngStr);
+                     map.openPopup(popup);
+       }                               
+       
+</script>
diff --git a/contenu/page-carte_de_sites.html~ b/contenu/page-carte_de_sites.html~
new file mode 100644 (file)
index 0000000..55380c6
--- /dev/null
@@ -0,0 +1,60 @@
+<div id="map" style="width: 540px; height: 400px"></div>
+
+
+
+       <BOUCLE_ateliers(MOTS){type = Ateliers}{!par id_mot}>
+               #URL_SITE_SPIP/IMG#LOGO_MOT**
+       </BOUCLE_ateliers>
+
+
+<script src="#CONFIG{adresse_site}/lib/CloudMade-Leaflet-404b097/dist/leaflet.js"></script>
+<script>
+       var map = new L.Map('map');
+       
+       var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
+               cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
+               cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
+       
+       map.setView(new L.LatLng(46.8, 2.52), 5).addLayer(cloudmade);
+  
+       var WorkshopIcon = L.Icon.extend({
+           iconUrl: '#CONFIG{adresse_site}/plugins/carte-de-sites/images/grey.png',
+           shadowUrl: '#CONFIG{adresse_site}/lib/CloudMade-Leaflet-404b097/dist/images/marker-shadow.png',
+           iconSize: new L.Point(25, 41),
+           shadowSize: new L.Point(41, 41),
+           iconAnchor: new L.Point(13, 41),
+           popupAnchor: new L.Point(0, -33)
+       });             
+       
+       var     greyIcon = new WorkshopIcon()
+                       redIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/red.png'),
+                       yellowIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/yellow.png'),
+                       blueIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/blue.png'),
+                       greenIcon = new WorkshopIcon('#CONFIG{adresse_site}/plugins/carte-de-sites/images/green.png');
+       
+
+       <BOUCLE_ateliers_types(MOTS){type = Ateliers}{!par id_mot}>
+                       <BOUCLE_sites(SITES){id_mot}>
+                                       <BOUCLE_coord(GIS){id_syndic}>
+                                                       siteIcon = new WorkshopIcon('#CONFIG{adresse_site}/IMG/[(#LOGO_MOT|fichier)]')
+                                                       var markerGrenoble = new L.Marker(new L.LatLng(#LAT, #LON), {icon: siteIcon});
+                                                       map.addLayer(markerGrenoble);
+                                                       markerGrenoble.bindPopup("<a href='#URL_SITE'>#NOM_SITE</a><br/>#_sites:DESCRIPTIF<br/>#ADRESSE<br/> #CODE_POSTAL #VILLE<br/><br/><em>Statut: #_ateliers_types:TITRE</em>");
+                                       </BOUCLE_coord>
+                       </BOUCLE_sites>
+       </BOUCLE_ateliers_types>
+       
+                       
+       map.on('click', onMapClick);
+       
+       var popup = new L.Popup();
+
+             function onMapClick(e) {
+                     var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
+
+                     popup.setLatLng(e.latlng);
+                     popup.setContent("You clicked the map at " + latlngStr);
+                     map.openPopup(popup);
+       }                               
+       
+</script>
diff --git a/images/blue.png b/images/blue.png
new file mode 100644 (file)
index 0000000..3d2daf2
Binary files /dev/null and b/images/blue.png differ
diff --git a/images/green.png b/images/green.png
new file mode 100644 (file)
index 0000000..07f5e51
Binary files /dev/null and b/images/green.png differ
diff --git a/images/grey.png b/images/grey.png
new file mode 100644 (file)
index 0000000..07faa93
Binary files /dev/null and b/images/grey.png differ
diff --git a/images/orange.png b/images/orange.png
new file mode 100644 (file)
index 0000000..2559da0
Binary files /dev/null and b/images/orange.png differ
diff --git a/images/ptitvelo.png b/images/ptitvelo.png
new file mode 100755 (executable)
index 0000000..1071320
Binary files /dev/null and b/images/ptitvelo.png differ
diff --git a/images/red.png b/images/red.png
new file mode 100644 (file)
index 0000000..9a1cafa
Binary files /dev/null and b/images/red.png differ
diff --git a/images/workshop.xcf b/images/workshop.xcf
new file mode 100644 (file)
index 0000000..2d8fb9b
Binary files /dev/null and b/images/workshop.xcf differ
diff --git a/images/yellow.png b/images/yellow.png
new file mode 100644 (file)
index 0000000..1b6249f
Binary files /dev/null and b/images/yellow.png differ
diff --git a/plugin.xml b/plugin.xml
new file mode 100644 (file)
index 0000000..83a84b7
--- /dev/null
@@ -0,0 +1,23 @@
+<plugin>
+    <nom>Carte de sites par mot clé avec Leaflet</nom>
+    <version>0.1</version>
+    <auteur>Ludovic CHEVALIER</auteur>
+    <licence>GNU/GPL</licence>
+    <description>
+        Ce plugin permet de générer une carte de sites à partir des sites references dans SPIP,
+        auquels on a ajoute un mot cle. Les marqueurs de la carte prennent comme source
+        d'image le logo du mot cle. 
+    </description>
+    <prefix>carte_de_sites</prefix>
+    <etat>dev</etat>
+    <necessite id="SPIP" version="[2.1.11;2.1.99]" />
+    <necessite id="gis" version= "[2.1.1;]" />
+    <necessite
+        id="lib:CloudMade-Leaflet-404b097"
+        src="https://nodeload.github.com/CloudMade/Leaflet/zipball/v0.2.1"
+    />
+       <pipeline>
+                       <nom>insert_head</nom>
+                       <inclure>carte_de_sites_pipelines.php</inclure>
+       </pipeline>
+</plugin>
diff --git a/test.html b/test.html
new file mode 100644 (file)
index 0000000..661bacd
--- /dev/null
+++ b/test.html
@@ -0,0 +1,2 @@
+[(#REM) Carte des ateliers ]
+<INCLURE{fond=structure}{env}{type=page}{composition=carte_de_sites} />
\ No newline at end of file