javascript - Is it possible to hide Google Map but keep Search Bar? -
i'm trying create homepage search bar google places search bar. want display google map results on next page along city searched.
i have found examples of how hide search box , ui of google map.
is there way use google maps & places api hide map , keep search functionality search box?
you don't need google.maps.map
object use places searchbox
code snippet:
function initautocomplete() { // create search box , link ui element. var input = document.getelementbyid('pac-input'); var searchbox = new google.maps.places.searchbox(input); }
html, body { height: 100%; margin: 0; padding: 0; } #pac-input { background-color: #fff; font-family: roboto; font-size: 15px; font-weight: 300; margin-left: 12px; padding: 0 11px 0 13px; text-overflow: ellipsis; width: 300px; } #pac-input:focus { border-color: #4d90fe; } .pac-container { font-family: roboto; } #type-selector { color: #fff; background-color: #4d90fe; padding: 5px 11px 0px 11px; } #type-selector label { font-family: roboto; font-size: 13px; font-weight: 300; } #target { width: 345px; }
<input id="pac-input" class="controls" type="text" placeholder="search box"> <script src="https://maps.googleapis.com/maps/api/js?libraries=places&callback=initautocomplete" async defer></script>