Skip to content

Commit

Permalink
Auto stash before merge of "master" and "origin/master"
Browse files Browse the repository at this point in the history
  • Loading branch information
rorp24 committed May 10, 2019
1 parent 56f7bf2 commit 87877ca
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 48 deletions.
3 changes: 2 additions & 1 deletion src/app/new-visit/new-visit.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ export class NewVisitPage implements OnInit {
//quand on trouve l'utilisateur
onLocationFound(e)
{
//on supprime le point
if(this.userPosPoint)
{
this.userPosPoint.remove()
}
//on pose un marqueur sur sa position
//on pose un point sur sa position
this.userPosPoint = L.circleMarker(e["latlng"],{color:'#FF8C00', fillOpacity:1, radius: 3}).addTo(this.map)
}

Expand Down
31 changes: 8 additions & 23 deletions src/app/start-input/start-input.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare var L: any;
export class StartInputPage implements OnInit {
//variables de la page
map:L.Map;
marque;
userPosPoint;
data: geoJSON.FeatureCollection;
testeur = 0;
modif = 100;
Expand Down Expand Up @@ -139,23 +139,6 @@ export class StartInputPage implements OnInit {
this.menu.enable(true, "VisuTaxon");
//on recharge rapidement la carte
this.map.invalidateSize();

//on réafirme les paramêtre des marqueurs
const iconRetinaUrl = 'assets/leaflet/marker-icon-2x.png';
const iconUrl = 'assets/leaflet/marker-icon.png';
const shadowUrl = 'assets/leaflet/marker-shadow.png';
const iconDefault = L.icon({
iconRetinaUrl,
iconUrl,
shadowUrl,
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
tooltipAnchor: [16, -28],
shadowSize: [41, 41]
});
L.Marker.prototype.options.icon = iconDefault;
//fin réafirmation

//on géolocalise un utilisateur
this.map.locate({
Expand Down Expand Up @@ -183,12 +166,13 @@ export class StartInputPage implements OnInit {
/*centre*/[e["latitude"], e["longitude"]],
/*zoom*/11
);
//on supprime les marqueurs s'ils existent
if (this.marque)
//on supprime le point
if(this.userPosPoint)
{
this.marque.remove();
this.userPosPoint.remove()
}
this.marque = L.marker(e["latlng"]).addTo(this.map); //on place une marque où ce trouve l'utilisateur
//on pose un marqueur sur sa position
this.userPosPoint = L.circleMarker(e["latlng"],{color:'#FF8C00', fillOpacity:1, radius: 3}).addTo(this.map)
//on indique qu'on a fini de charger
for(const feature in this.data)
{
Expand All @@ -200,7 +184,8 @@ export class StartInputPage implements OnInit {
"Voulez vous visiter ce site?")
if(validation)
{
this.watchArea(feature)
this.watchArea(parseInt(feature)+1)
break
}
}
}
Expand Down
31 changes: 7 additions & 24 deletions src/app/visionnage/visionnage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class VisionnagePage implements OnInit {
public id;
map:L.Map;
data = []
marque
userPosPoint
nomCommune
nomTaxon

Expand Down Expand Up @@ -106,28 +106,6 @@ export class VisionnagePage implements OnInit {
this.map.invalidateSize();
this.nomCommune = this.data[0]["properties"]["nom_commune"]
this.nomTaxon = this.data[0]["properties"]["nom_taxon"]
//on réafirme les paramêtre des marqueurs
const iconRetinaUrl = 'assets/leaflet/marker-icon-2x.png';
const iconUrl = 'assets/leaflet/marker-icon.png';
const shadowUrl = 'assets/leaflet/marker-shadow.png';
const iconDefault = L.icon({
iconRetinaUrl,
iconUrl,
shadowUrl,
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
tooltipAnchor: [16, -28],
shadowSize: [41, 41]
});
L.Marker.prototype.options.icon = iconDefault;
//fin réafirmation

//on supprime les marqueurs s'ils existent
if(this.marque)
{
this.marque.remove();
}

//on géolocalise un utilisateur
this.map.locate({
Expand Down Expand Up @@ -156,7 +134,12 @@ export class VisionnagePage implements OnInit {
//quand on trouve l'utilisateur
onLocationFound(e)
{
//on supprime le point
if(this.userPosPoint)
{
this.userPosPoint.remove()
}
//on pose un marqueur sur sa position
this.marque = L.marker(e["latlng"]).addTo(this.map)
this.userPosPoint = L.circleMarker(e["latlng"],{color:'#FF8C00', fillOpacity:1, radius: 3}).addTo(this.map)
}
}

0 comments on commit 87877ca

Please sign in to comment.