2017 © Pedro Peláez
 

yii2-extension yii2-latlng-finder

Find Latitude and Longitude using google maps

image

ibrarturi/yii2-latlng-finder

Find Latitude and Longitude using google maps

  • Thursday, December 17, 2015
  • by ibrarturi
  • Repository
  • 2 Watchers
  • 6 Stars
  • 954 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

LatLngFinder

Find Latitude and Longitude using Google Maps, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist ibrarturi/yii2-latlng-finder "dev-master"

or add, (*4)

"ibrarturi/yii2-latlng-finder": "dev-master"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code mentioned below. Click once on the map to the get the marker and coordinates then you can drag the marker around to the desired place on the map., (*6)

  • Default usage


= \ibrarturi\latlngfinder\LatLngFinder::widget(); ?>
  • Default usage without Zoom Field


= \ibrarturi\latlngfinder\LatLngFinder::widget([ 'enableZoom' => false // true, false ]); ?>
  • Default usage with optional parameters


= \ibrarturi\latlngfinder\LatLngFinder::widget([ 'latAttribute' => 'lat', // Latitude text field id 'lngAttribute' => 'lng', // Longitude text field id 'zoomAttribute' => 'zoom', // Zoom text field id 'mapCanvasId' => 'map', // Map Canvas id 'mapWidth' => 450, // Map Canvas width 'mapHeight' => 300, // Map Canvas mapHeight 'defaultLat' => -34.397, // Default latitude for the map 'defaultLng' =>150.644, // Default Longitude for the map 'defaultZoom' => 8, // Default zoom for the map 'enableZoomField' => true, // True: for assigning zoom values to the zoom field, False: Do not assign zoom value to the zoom field ]); ?>
  • Default usage with model
= $form->field($model, 'lat') ?>
= $form->field($model, 'lng') ?>
= $form->field($model, 'zoom') ?>

= \ibrarturi\latlngfinder\LatLngFinder::widget([
    'model' => $model,              // model object
]); ?>

 ```

  * Default usage with model without zoom field

```php
= $form->field($model, 'lat') ?>
= $form->field($model, 'lng') ?>

= \ibrarturi\latlngfinder\LatLngFinder::widget([
    'model' => $model,              // model object
    'enableZoom' => false           // true, false
]); ?>

 ```

 * Default usage with model and optional parameters

```php
= $form->field($model, 'lat') ?>
= $form->field($model, 'lng') ?>
= $form->field($model, 'zoom') ?>

= \ibrarturi\latlngfinder\LatLngFinder::widget([
    'model' => $model,              // model object
    'latAttribute' => 'lat',        // Latitude attribute
    'lngAttribute' => 'lng',        // Longitude attribute
    'zoomAttribute' => 'zoom',      // Zoom text attribute
    'mapCanvasId' => 'map',         // Map Canvas id
    'mapWidth' => 450,              // Map Canvas width
    'mapHeight' => 300,             // Map Canvas mapHeight
    'defaultLat' => -34.397,        // Default latitude for the map
    'defaultLng' =>150.644,         // Default Longitude for the map
    'defaultZoom' => 8,             // Default zoom for the map
    'enableZoomField' => true,      // True: for assigning zoom values to the zoom field, False: Do not assign zoom value to the zoom field
]); ?>

Resources

The Versions

17/12 2015

dev-master

9999999-dev

Find Latitude and Longitude using google maps

  Sources   Download

MIT

The Requires

 

by Ibrar Turi

extension yii2 coordinates latitude longitude picker google map finder