My usage scenario here is to verify whether the selected longitude and latitude belong to the specified province or city.
Get the area code for comparison
- Encapsulated query class
<?php
namespace app\common\library;
class SelectLngLatData
{
protected static $instance;
protected $option = [];
protected $time = 0;
protected $errorMessage = '';
public function __construct($lng = 0, $lat = 0)
{
$this->time = time();
$this->option['lng'] = $lng;
$this->option['lat'] = $lat;
}
private function __clone()
{
}
public static function instance($lng = 0, $lat = 0)
{
if (is_null