Commit 95223bfd authored by Thomas Frion's avatar Thomas Frion

[FEAT] Get overlay inside boundaries (start up)

parent ca738db8
......@@ -72,7 +72,7 @@ export class MapComponent implements OnInit {
MapComponent.ddToDMS(coordinates[0],coordinates[1]) + "<br>" +
"<b>Lat: </b>"+ coordinates[0] +", <b>Lon: </b>" + coordinates[1]);
this.getGendarmeries();
// this.getGendarmeries();
}
ngOnInit(): void {
......@@ -110,15 +110,16 @@ export class MapComponent implements OnInit {
});
this.map.on("zoomend", function(){
if(this.getZoom() >= 12){
if(!this.hasLayer(gendLAyer)){
this.addLayer(gendLAyer);
}
}else{
if(this.hasLayer(gendLAyer)){
this.removeLayer(gendLAyer);
}
}
console.log(this.getBounds());
// if(this.getZoom() >= 12){
// if(!this.hasLayer(gendLAyer)){
// this.addLayer(gendLAyer);
// }
// }else{
// if(this.hasLayer(gendLAyer)){
// this.removeLayer(gendLAyer);
// }
// }
});
L.control.layers(this.baseMap).addTo(this.map);
......
......@@ -29,7 +29,7 @@ export interface UnitSetting{
export interface Unit{
readonly id?: number,
code: string,
nom: string,
name: string,
email: string,
geom: string,
dept: string,
......@@ -48,7 +48,7 @@ export class UnitModel {
constructor(unit : Unit) {
this.id = unit.id;
this.code = unit.code;
this.name = unit.nom;
this.name = unit.name;
this.email = unit.email;
this.geom = unit.geom;
this.dept = unit.dept;
......
......@@ -91,7 +91,7 @@
<dt><b>Code</b></dt>
<dd>{{unit.code}}</dd>
<dt><b>Nom</b></dt>
<dd>{{unit.nom}}</dd>
<dd>{{unit.name}}</dd>
<dt><b>Email</b></dt>
<dd><a href="mailto:{{unit.email}}">{{unit.email}}</a></dd>
</dl>
......
......@@ -18,7 +18,7 @@ class UnitSerializer(serializers.ModelSerializer):
class Meta:
model = Unit
fields = ['code', 'nom', 'email', 'geom', 'dept', 'settings']
fields = ['code', 'name', 'email', 'geom', 'dept', 'settings']
extra_kwargs = {
'code': {'validators': [not_empty]}, # Set validators
'email':{'validators': [not_empty]},
......
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