Skip to content

Commit

Permalink
Commit map WORKING avant changement google maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
campignon committed Jan 16, 2016
1 parent 77f7e0d commit 812cb35
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 72 deletions.
3 changes: 0 additions & 3 deletions src/UrgenceBundle/Resources/public/js/alerterModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ var alerterModule = (function() {

map.on('click', function(e) {
if (map_enabled) {
if (myLayer.length >= 1) {
myLayer.
}
map.panTo(e.latlng);
setPosition(map, myLayer, e);
}
Expand Down
69 changes: 1 addition & 68 deletions src/UrgenceBundle/Resources/public/js/mapModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,74 +13,7 @@ var mapModule = (function() {
return map;
};

function addFakeData(map) {
// Ajout de markers
for(i = 0; i < 10; i++) {
var rlat = Math.random()/1000;
var rlong = Math.random()/1000;
L.mapbox.featureLayer({
// this feature is in the GeoJSON format: see geojson.org
// for the full specification
type: 'Feature',
geometry: {
type: 'Point',
// coordinates here are in longitude, latitude order because
// x, y is the standard for GeoJSON and many formats
coordinates: [
2.3185+rlong,
48.89668+rlat
]
},
properties: {
title: 'Peregrine Espresso',
description: '1718 14th St NW, Washington, DC',
// one can customize markers by adding simplestyle properties
// https://www.mapbox.com/guides/an-open-platform/#simplestyle
'marker-size': 'large',
'marker-color': '#DB1616',
'marker-symbol': 'marker'
}
}).addTo(map);
}

// Ajout d'une zone de type 'Cercle'
// Define circle options
// http://leafletjs.com/reference.html#circle
var circle_options = {
color: '#db1616', // Stroke color
opacity: 1, // Stroke opacity
weight: 10, // Stroke weight
fillColor: '#FF8585', // Fill color
fillOpacity: 0.6 // Fill opacity
};

var circle = L.circle([48.89668, 2.3185], 200, circle_options).addTo(map);

// Ajout d'une zone de type 'Polygone'
// Create array of lat,lon points.
var line_points = [
[48.89782, 2.32278],
[48.89781, 2.32572],
[48.8968, 2.32757],
[48.89566, 2.32656],
[48.89534, 2.32443],
[48.89782, 2.32278]
];

// Define polyline options
// http://leafletjs.com/reference.html#polyline
var polyline_options = {
color: '#000'
};

// Defining a polygon here instead of a polyline will connect the
// endpoints and fill the path.
// http://leafletjs.com/reference.html#polygon
var polyline = L.polyline(line_points, polyline_options).addTo(map);
};

return {
init: init,
addFakeData: addFakeData
init: init
};
})();
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<script type="application/javascript">
$( document ).ready(function() {
var map = mapModule.init('map-voir-alertes');
mapModule.addFakeData(map);
});
</script>
{% endblock %}

0 comments on commit 812cb35

Please sign in to comment.