locationpicker Enable to pick location in form

  1. Requirement
  2. Usage
  3. Screenshot

CLocationPicker is Yii extension to display latitude & longitude data with google map.

Requirement

Gii or Giix

Usage

  • simply copy the extension to to protected/extensions/ folder
  • your model must have latitude/lat and longitude/lng attribute

Before

<div class="form-group">
    <?php echo $form->labelEx($model,'latitude', array('class'=>'col-sm-3 control-label')); ?>            
    <div class="col-sm-9">
        <?php echo $form->textField($model, 'latitude',array('class'=>'form-control','maxlength'=>'20')); ?>
        <?php echo $form->error($model,'latitude'); ?>
    </div>
</div>
<div class="form-group">
    <?php echo $form->labelEx($model,'longitude', array('class'=>'col-sm-3 control-label')); ?>            
    <div class="col-sm-9">
        <?php echo $form->textField($model, 'longitude',array('class'=>'form-control','maxlength'=>'20')); ?>
        <?php echo $form->error($model,'longitude'); ?>
    </div>
</div>

After

<div class="form-group">
    <label class="col-sm-3 control-label">Location</label>
    <div class="col-sm-9">
        <?php
        $this->widget('ext.locationpicker.LocationPicker', array(
            'model' => $model,
            'latId' => "latitude", //can be replaced using your own attribute
            'lonId' => "longitude", //can be replaced using your own attribute
        ));
        ?>
    </div>
</div>

Screenshot

http://s21.postimg.org/xhy500y4n/Screen_Shot_2014_03_24_at_3_05_57_PM.png

0 0
3 followers
574 downloads
Yii Version: 1.1
License: GPL-3.0
Category: User Interface
Developed by: Febrianto Arif
Created on: Mar 24, 2014
Last updated: 9 years ago

Downloads

show all

Related Extensions