Yii 1.1: coordinatepicker

Widget to pick coordinates using google map in modal window

Widget that allows to pick coordinates using google map in modal window


Tested on Yii 1.1.10, but shoul work on previous versions too.


  1. Checkout source code to your project, for example to ext.coordinatepicker.
  2. Render inputs.
  3. Register script with widget.


Coordinate inputs: Inputs

Picker popup: popup

echo $form->textField($model, 'lat');
echo $form->textField($model,'long');
$this->widget('ext.coordinatepicker.CoordinatePicker', array(
    'model' => $model,
    'latitudeAttribute' => 'lat',
    'longitudeAttribute' => 'long',
    //optional settings
    'editZoom' => 12,
    'pickZoom' => 7,
    'defaultLatitude' => 50.443513052458044,
    'defaultLongitude' => 30.498046875,


  • September 27 - Replaced "text-indent: -99999999px;" hacks in css, to fix apearance in updated
  • August 9 - Replaced "0+text" expression in script by parseFloat(), added check for NaN value.


Total 11 comments

#20144 report it
ratnaparkhi at 2017/11/15 04:01am
i am getting Maps API error: MissingKeyMapError

I am using Yii1 i have added this extension on my site before 2 yrs. It was working fine. but now it is giving me following error I am getting Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error

please help me

#19522 report it
ahmed.ismail at 2015/08/19 11:17am
Hello, is there a version for yii2?

My app uses yii2.

#19065 report it
josimarjafa at 2015/03/07 08:35am

it doesn't work on yii2

#14897 report it
karte at 2013/09/19 07:10am
Amazing extension

Its Working like a charm!!!!!!!!! thanks for the great extension....

#13765 report it
Paul_Kish at 2013/06/24 03:27am

Thanks for the great extension. It works tried it out on Yii 1.12 along with Yii Bootstrap no conflicts

#10630 report it
Hwangar at 2012/11/09 04:34am

I have fixed it... problem is settings were stored in global space. I can send you the corrections if you want

#10628 report it
Hwangar at 2012/11/09 03:04am
other bug...

Hey Bogdan, this time I discovered that putting several widgets on same page... all coordinate pickers update the LAST lat,lon textboxes

i'll try to review if I can detect where the mistake is and will tell you

anyway good job man! Juan Arias

#9418 report it
Bogdan Savluk at 2012/08/09 10:57am
Re: Bug??

Interesting - it was working for me(in latest Chrome web browser).

Anyway I have replaced "0+text" expression by parseFloat() also added check for NaN value, after parsing value. I hope this will help.

#9417 report it
Hwangar at 2012/08/09 09:45am

In php 5.3, I had to change in map.js the parsing of lat an long from: coord_long = 0 + $(settings.lat_selector, window.parent.document).attr('value'); to... coord_long = parseFloat($(settings.long_selector, window.parent.document).attr('value'));

I was giving me NaN's on interface

Thx anyway!!!

#8947 report it
Bogdan Savluk at 2012/07/09 09:44am
Re: a few suggestions

I have added settings for:

  • default latidute/longitude
  • default zoom levels (separately for picking and editing coordinates)

About settings for pin updating when changing zoom or dragging map: I see no reason to do so, because plugin interface was designed to always keep pin in center of map.

#8940 report it
andyofb at 2012/07/09 06:43am
Great extension... a few suggestions

There were a couple of things I wanted to change right off the bat and I think other people would so would be great if you could have some config data set (as with components). These would include: - setting the default lat,lng - setting the default zoom level - turn on/off update pin on change (moving the map) - turn on/off update pin on zoom

Good work!

Leave a comment

Please to leave your comment.

Create extension