pigochu/yii2-jquery-locationpicker

How to Displaying Maps in view with id after save

Closed this issue · 7 comments

How to Displaying Maps in view with id after save ...

I don't understand, could you tell me more details?

like this..

capture

@cobabikin

If you want to display this map in your "actionView"

you can also use LocationPickerWidget

<?php
    echo \pigolab\locationpicker\LocationPickerWidget::widget([
       'key' => 'abcabcabcabc ...', // require , Put your google map api key
        'clientOptions' => [
            'location' => [
                'latitude'  => 46.15242437752303 ,
                'longitude' => 2.7470703125,
            ],
        ]        
    ]);
?>

you must set latitude & longitude , but I don't know how do you save latitude & longitude .
If you use mysql's Point type , you must select it use ST_X & ST_Y

You can read sample from https://github.com/pigochu/yii2-jquery-locationpicker/blob/master/doc/MYSQL-SPATIAL-CONVERSION.md

example :

        $this->addSelect(new Expression("ST_X([[{$fieldName}]]) as latitude"));
        $this->addSelect(new Expression("ST_Y([[{$fieldName}]]) as longitude"));

Thanks for answering my question..im waiting example project yii2-jquery-locationpicker use mysql's Point type.. :( sorry my english is bad

you are welcom

my english is aslo very very bad.

How To Remove Picker Icon When i used to show location only ... I am using it in DetailView ...
I have my latlong values .... and i only want to show maps ... I dont need picker icon ... Is it possible to remove it. Thankx

demo

http://logicify.github.io/jquery-locationpicker-plugin/

I found default options has markerVisible.
But I never try it :)