Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
project:electronomy [2013/03/22 16:53] – [Electronomy] fabienroduit | project:electronomy [2013/08/15 22:23] (current) – tagged loleg | ||
---|---|---|---|
Line 15: | Line 15: | ||
3 - En multipliant (2) par (3), la consommation électrique de la commune est évaluée. | 3 - En multipliant (2) par (3), la consommation électrique de la commune est évaluée. | ||
- | 4 (optionnel) - Le marquge | + | 4 (optionnel) - Le marquage |
== B - Productions potentielles de PV par commune == | == B - Productions potentielles de PV par commune == | ||
Line 28: | Line 28: | ||
5 - En multipliant (2) par (3) par (4), déduction du potentiel de production communal | 5 - En multipliant (2) par (3) par (4), déduction du potentiel de production communal | ||
- | |||
- | |||
===== Data ===== | ===== Data ===== | ||
Line 35: | Line 33: | ||
* List and link your actual and ideal data sources. | * List and link your actual and ideal data sources. | ||
+ | ===== Capture d' | ||
+ | |||
+ | ===== Captures ===== | ||
+ | |||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | |||
+ | ===== Code ===== | ||
+ | |||
+ | Index.html : | ||
+ | |||
+ | <code html> | ||
+ | < | ||
+ | <script type=" | ||
+ | var map,popup; | ||
+ | | ||
+ | map = new GeoAdmin.Map(" | ||
+ | map.switchComplementaryLayer(' | ||
+ | // Ajout du layer pour voir les communes | ||
+ | map.addLayerByName(" | ||
+ | // Ajout du layer pour voir les limites du canton | ||
+ | map.addLayerByName(" | ||
+ | map.zoomToExtent(new OpenLayers.Bounds(543550, | ||
+ | |||
+ | // Dessiner un cercle | ||
+ | var vector = new OpenLayers.Layer.Vector(" | ||
+ | styleMap: new OpenLayers.StyleMap({ | ||
+ | " | ||
+ | pointRadius: | ||
+ | fillColor: "# | ||
+ | fillOpacity: | ||
+ | strokeColor: | ||
+ | strokeOpacity: | ||
+ | strokeWidth: | ||
+ | }), | ||
+ | " | ||
+ | pointRadius: | ||
+ | fillColor: ' | ||
+ | fillOpacity: | ||
+ | strokeColor: | ||
+ | strokeOpacity: | ||
+ | }, OpenLayers.Feature.Vector.style.temporary) | ||
+ | }) | ||
+ | }); | ||
+ | |||
+ | // Dessiner un cercle sur Martigny | ||
+ | var feature1 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(572494, | ||
+ | attributes: {text: ' | ||
+ | }); | ||
+ | // Dessiner un cercle sur Sion | ||
+ | var feature2 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(596118, | ||
+ | attributes: {text: ' | ||
+ | }); | ||
+ | |||
+ | // Add features | ||
+ | vector.addFeatures([feature1, | ||
+ | |||
+ | map.addLayers([vector]); | ||
+ | |||
+ | // Attach a control on the feature to display the popup on hover | ||
+ | var hover = new OpenLayers.Control.SelectFeature(vector, | ||
+ | renderIntent: | ||
+ | hover: true, | ||
+ | highlightOnly: | ||
+ | eventListeners: | ||
+ | featurehighlighted: | ||
+ | popup = new OpenLayers.Popup.FramedCloud(" | ||
+ | new OpenLayers.LonLat(data.feature.geometry.x, | ||
+ | new OpenLayers.Size(40, | ||
+ | "< | ||
+ | null, | ||
+ | false | ||
+ | ); | ||
+ | map.addPopup(popup); | ||
+ | }, | ||
+ | featureunhighlighted: | ||
+ | map.removePopup(popup); | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | // Add the control to the map | ||
+ | map.addControls([hover]); | ||
+ | |||
+ | hover.activate(); | ||
+ | } | ||
+ | </ | ||
+ | <body onload=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | GetCentroid.html | ||
+ | |||
+ | <code html> | ||
+ | < | ||
+ | <script src=" | ||
+ | |||
+ | < | ||
+ | $(document).ready(function() { | ||
+ | var url = ' | ||
+ | | ||
+ | // A completer par le npa de toutes les communes | ||
+ | var test = new Array(); | ||
+ | test[0] = 3960; | ||
+ | test[1] = 1920; | ||
+ | test[2] = 1950; | ||
+ | |||
+ | for (var i=0; | ||
+ | |||
+ | $.getJSON(url + '? | ||
+ | $.each(data.results, | ||
+ | var content = "NPA: " +val.nr+ "< | ||
+ | content += " | ||
+ | var coord = new Array(); | ||
+ | $.each(val.bbox, | ||
+ | coord[i] = j; | ||
+ | }); | ||
+ | |||
+ | // Avoir la longitude et latitude de la commune | ||
+ | content += coord[0]+6400+" | ||
+ | content += coord[1]+6400; | ||
+ | content += "< | ||
+ | $('# | ||
+ | }); | ||
+ | }); | ||
+ | } | ||
+ | }); | ||
+ | </ | ||
+ | < | ||
+ | <div id=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | * Problèmes à regler centroid | ||
+ | * Manque plus que le for each sur chaque communes | ||
===== Team ===== | ===== Team ===== | ||
* [[user: | * [[user: | ||
* Grégoire Largey | * Grégoire Largey | ||
- | * | + | * Anthony Bernardo |
+ | * Romain Paccolat | ||
+ | |||
+ | ===== Data ===== | ||
+ | |||
+ | * {{: | ||
===== Links ===== | ===== Links ===== | ||
Line 47: | Line 190: | ||
* Tools you used ... | * Tools you used ... | ||
| | ||
- | {{tag> | + | {{tag> |