pigochu / yii2-jquery-locationpicker

jquery location picker widget for yii2
20 stars 7 forks source link

How to Displaying Maps in view with id after save #6

Closed cobabikin closed 7 years ago

cobabikin commented 7 years ago

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

pigochu commented 7 years ago

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

cobabikin commented 7 years ago

like this..

capture

pigochu commented 7 years ago

@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"));
cobabikin commented 7 years ago

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

pigochu commented 7 years ago

you are welcom

my english is aslo very very bad.

deshario commented 6 years ago

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

pigochu commented 6 years ago

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

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