Поиск по адресу
This commit is contained in:
parent
396f9d0921
commit
049c877af5
|
|
@ -2,9 +2,9 @@
|
|||
<div id="footer">
|
||||
<div class="col-lg-3">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Поисл на карте...">
|
||||
<input type="text" id="addressField" class="form-control" placeholder="Поисл на карте..." onkeydown="if(event.keyCode == 13) {searchAdderess()}" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button"><span class="glyphicon glyphicon-search"></span></button>
|
||||
<button class="btn btn-default" type="button" onclick="searchAdderess()"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -91,3 +91,14 @@ function initCategories()
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
function searchAdderess()
|
||||
{
|
||||
var myGeocoder = ymaps.geocode($('#addressField').val());
|
||||
myGeocoder.then(
|
||||
function (res) {
|
||||
myMap.setCenter(res.geoObjects.get(0).geometry.getCoordinates(), 13);
|
||||
},
|
||||
function (err) {}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue