Support new dot group: blue.

This commit is contained in:
George Kaklamanos 2016-02-21 21:24:27 +02:00
parent 87932b8801
commit 2f96304eed

View file

@ -9,7 +9,7 @@
</style>
<?php
function ShowMap($coordsRed,$coordsGreen){
function ShowMap($coordsRed,$coordsGreen,$coordsBlue){
if(count($coordsRed)>0 || count($coordsGreen)>0){
?>
<div id="mymap"></div>
@ -65,6 +65,30 @@ echo '['. $coordsGreen[$i][1] . ',' . $coordsGreen[$i][0] . ']];';
features.push(feat);
}
<?php
}
if(count($coordsBlue)>0){
echo "var coordinatesBlue = [";
for ($i=0; $i<count($coordsBlue)-1;$i++){
$loc = $coordsBlue[$i];
echo '['. $loc[1] . ',' . $loc[0] . '],';
}
echo '['. $coordsBlue[$i][1] . ',' . $coordsBlue[$i][0] . ']];';
?>
var styleBlue = new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({color: '#0000FF'}),
stroke: new ol.style.Stroke({color: '#000000'}),
radius: 5
})
});
for(var i=0; i<coordinatesBlue.length; i++){
var feat = new ol.Feature({
geometry: new ol.geom.Point(new ol.proj.fromLonLat([coordinatesBlue[i][0],coordinatesBlue[i][1]]))
});
feat.setStyle(styleBlue);
features.push(feat);
}
<?php
}
?>
var vectorSource = new ol.source.Vector({features:features});