dev-master
9999999-dev https://github.com/UsefulWeb/yii2-leaflet-searchLeaflet search widget for Yii2
The Requires
- php >=5.4.0
by Vladimir Yazykov
yii2 search leaflet geocoder
Leaflet search widget for Yii2
Yii2 leaflet search plugin, (*1)
First, include this scripts:, (*2)
<!-- leaflet library --> <script src="/assets/6268c434/leaflet.js"></script> <!-- https://github.com/perliedman/leaflet-control-geocoder--> <script src="/assets/961614a3/Control.Geocoder.js"></script> <!-- \usefulweb\yii2-leaflet-search\dist\leaflet-search.js --> <script src="/assets/c01748f9/leaflet-search.js"></script>
And then you can use this plugin, (*3)
'search-longitude', ]) ?>'search-latitude', ]) ?>'search-radius', ]) ?>'search-longitude', // id of latitude field 'latitude' => 'search-latitude', // id of radius field: optional 'radius' => 'search-radius', // htmloptions for map container 'htmlOptions' => [ 'style' => 'width:900px;height:300px;' ], 'options' => [ 'map' => [ // leaflet map options, see http://leafletjs.com/reference.html#map-options 'options' => [], // leaflet default view options, see http://leafletjs.com/reference.html#map-setview 'defaultView' => [[55.7198,37.6989], 10], // default map zoom (used for panning to coordinates from field values) 'defaultZoom' => 10, ], // leaflet-geocoder-control options, see https://github.com/perliedman/leaflet-control-geocoder#options 'geocoder' => [ 'placeholder' => 'Search...', 'radiusSize' => 100, 'collapsed' => false, ] ], ]) ?>
First, you need to extend \usefulweb\LeafletSearch\LeafletSearchAsset:, (*4)
in your php file add this lines, (*5)
Leaflet search widget for Yii2
yii2 search leaflet geocoder