Skip to content

Commit

Permalink
Add T3 guild claim circle to planner layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyut0n committed Aug 14, 2020
1 parent 75447f1 commit 5340a0f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions js/livemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,23 @@ function Livemap( controller ) {
} )
.addTo(layerGroup);
} );
// Mouse Circle
// Mouse Circles
layer.mouseCircle = L.circle( layer.config.mousePosition, {
weight: 0,
fillColor: this.config.mouseCircleColor,
fillOpacity: 0.5,
fillOpacity: 0.3,
radius: this.config.mouseCircleRadius,
interactive: false,
} )
.addTo(layer.layerGroup);
layer.mouseCircleTwo = L.circle( layer.config.mousePosition, {
weight: 0,
fillColor: this.config.mouseCircleColor,
fillOpacity: layer.config.outpostMode ? 0 : 0.3,
radius: 50,
interactive: false,
} )
.addTo(layer.layerGroup);
// Mouse Label
layer.mouseLabel = L.tooltip( {
permanent: true,
Expand All @@ -316,8 +324,9 @@ function Livemap( controller ) {
};
layer.moveEvent = function(event) {
// Follow mouse
this.mouseCircle.setLatLng(event.latlng);
this.mouseLabel.setLatLng(event.latlng);
this.mouseCircle.setLatLng(event.latlng);
this.mouseCircleTwo.setLatLng(event.latlng);
// Check Area
var blocked = false;
var mouse = self.c2px(event.latlng);
Expand All @@ -337,9 +346,10 @@ function Livemap( controller ) {
}
}
this.mouseCircle.setStyle({fillColor: blocked ? "#ffff00" : "#00ff00"});
this.mouseCircleTwo.setStyle({fillColor: blocked ? "#ffff00" : "#00ff00"});
};
layer.clickEvent = function(event) {
this.config.mouseCircleRadius = this.config.mouseCircleRadius === 75 ? 150 : 75;
this.config.mouseCircleRadius = this.config.mouseCircleRadius === 75 ? 150 : 75;
this.config.outpostMode = !this.config.outpostMode;
this.config.mousePosition = event.latlng;
this.draw();
Expand Down Expand Up @@ -533,7 +543,6 @@ function Livemap( controller ) {
AurochsCowData: { name: Locale.ui[131], icon: "images/animals/cow.png" },
MooseData: { name: Locale.ui[132], icon: "images/animals/moose.png" },
};
console.log(data);
// Draw animal icons
data.forEach( function(spawn) {
if( ! animalData.hasOwnProperty(spawn.Animal) ) return false;
Expand Down

0 comments on commit 5340a0f

Please sign in to comment.