javascript - Add z-index to Google Maps API v3 autocomplete search box -
javascript - Add z-index to Google Maps API v3 autocomplete search box -
i'm using places search box google maps api v3 , trying search box placed on div. div has z-index
on 200 000 , background of div has z-index
on 100 000.
css:
.dim-page-view-background { background-color : rgba(255, 255, 255, 0.7); background-image : url(../../images/backgrounds/lined.png); display : none; height : 100%; left : 0; position : absolute; top : 0; width : 100%; z-index : 100000; } .dim-page-view-content { background-color : #ffffff; border-radius : 10px; display : none; margin-left : 20px; padding : 25px 30px; position : absolute; text-align : justify; top : 60px; width : 500px; z-index : 200000; }
html:
<div class="dim-page-view-background"></div> <div class="dim-page-view-content"></div> <input type="text" name="textfield-address" id="search-place">
javascript:
function google_maps() { geocoder = new google.maps.geocoder(); var input = (document.getelementbyid('#search-place')); var search_field = new google.maps.places.searchbox((input)); map_options = { center: new google.maps.latlng(59.4, 13.5), draggable: true, zoom: 4, minzoom: 3, maxzoom: 18, pancontrol: true, streetviewcontrol: false, zoomcontrol: true, maptypecontrol: true, maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid(id_google_maps), map_options); google.maps.event.addlistener(search_field, 'places_changed', function() { // run code }); }
i hope got code you'll need :) how can search result visible on dim-page-view-background
, dim-page-view-content
divs? demo (click on cog in menu top of website , type place in text field placeholder "sök efter en plats (resultatet är gömd bakom innehållet, så det måste fixas)").
javascript css google-maps-api-3 google-places-api
Comments
Post a Comment