You are here

public function IpGeoLocPluginStyleLeaflet::pluginStyleLeafletCompare in IP Geolocation Views & Maps 8

Callback to compare locations based on weight.

File

src/Plugin/views/style/IpGeoLocPluginStyleLeaflet.php, line 1309

Class

IpGeoLocPluginStyleLeaflet
Views Style plugin extension for Leaflet (if enabled).

Namespace

Drupal\ip_geoloc\Plugin\views\style

Code

public function pluginStyleLeafletCompare($location1, $location2) {
  $weight1 = empty($location1->weight) ? 0 : $location1->weight;
  $weight2 = empty($location2->weight) ? 0 : $location2->weight;
  return $weight2 - $weight1;
}