Commit 62a45251 authored by Alexander's avatar Alexander

add a circle for the umkreissuche

parent bf93adb5
......@@ -29,7 +29,10 @@ import { OsmNodeService } from './osm-node.service';
import OlPolygon from 'ol/geom/Polygon';
import OlCircle from 'ol/geom/Circle';
import { featureloader } from 'openlayers';
import CircleStyle from 'ol/style/Circle';
import {Fill,Stroke} from 'ol/style';
//OlTransforms.transformExtent(extent,'EPSG:3857','EPSG:4326');
......@@ -407,12 +410,11 @@ export class MapService {
this.map.removeLayer(this.umkreisLayer);
this.umkreisLayer = new OlVectorLayer({
style: function(feature){
//TODO: decide differently if it is the radius
return feature.getStyle();
},
source: new OlVectorSource(
{
features: [this.umkreisFeature]
features: [this.umkreisFeature,this.umkreisRadiusFeature]
}
)
});
......@@ -609,21 +611,39 @@ export class MapService {
// TODO
// maybe place a marker here for the radius search
// TODO: consider that this marker be considered
// in this.rerender()
console.log("clicked at coordinates: "+latlon);
this.umkreisFeature = new OlFeature(new OlPoint(fromLonLat(latlon)));
this.umkreisFeature.setStyle(this.createStyle('assets/img/map-marker.png', undefined));
console.log(this.umkreisFeature);
//remove the old umkreissuche marker from the map
//and draw the updated one?
this.umkreisRadiusFeature= new OlFeature(new OlCircle(fromLonLat(latlon),50));
this.umkreisRadiusFeature.setStyle(
new OlStyle(
{
fill: new OlFill({color: [50,50,50,0.5]}),
stroke: new OlStroke({
width: 3,
color: [255,0,0,1]
}),
image: new CircleStyle({
fill: new Fill({
color: 'rgba(55, 200, 150, 0.5)'
}),
stroke: new Stroke({
width: 1,
color: 'rgba(55, 200, 150, 0.8)'
}),
radius: 7
}),
}
)
);
console.log(this.umkreisRadiusFeature);
this.rerender();
//@@Alexander
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment