Find "things" nearby, or as far away as possible, based on longitude and latitude.

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 7

Forks: 0

Open Issues: 4

pkg:composer/ludens-reklamebyra/proximity

v1.0.5 2015-09-21 14:32 UTC

This package is not auto-updated.

Last update: 2026-01-18 00:51:38 UTC


README

Build Status

Find "things" nearby, or as far away as possible, based on longitude and latitude.

Install

$ composer require ludens-reklamebyra/proximity

Usage

<?php
use Proximity\Proximity;

$dummyData = array(
    [
        'id' => 2,
        'latitude' => 59.878592,
        'longitude' => 10.807647
    ],
    [
        'id' => 4,
        'latitude' => 59.122701,
        'longitude' => 11.388684
    ],
    [
        'id' => 3,
        'latitude' => 62.596278,
        'longitude' => 6.443401
    ],
    [
        'id' => 5,
        'latitude' => 70.636660,
        'longitude' => 29.724778
    ],
);

$proximity = new Proximity($dummyData);
$proximity->search('risør', SORT_DESC);

new Proximity([elements], [options])

elements [array]

Each element has to include:

{
  longitude: float,
  latitude: float
}

options [array]

array(
    'language' => 'en' // Language of returned Google Maps results
)