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?
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.
http://logicify.github.io/jquery-locationpicker-plugin/
I found default options has markerVisible.
But I never try it :)