I'm using the Google Maps Places API Autocomplete function to provide a location autocomplete on a page, similar to this: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
I'm also using Google Material Design Lite to style my input boxes. This is all working fine, apart from the placeholder text. MDL uses label tags to provide placeholder text and a highlighting underline, but the Google Maps Places API uses a placeholder attribute on the input tag, which appears to override the MDL placeholder text and stop the underline effect from working; in addition, it appears I can't style the placeholder text for it to be a different color/opacity.
I'd like to be able to turn off the Google Maps Places API placeholder text, but even setting the attribute to be an empty string appears to break the Google MDL label (the placeholder text doesn't appear).
Is there a way I can stop the Google Maps API from putting placeholder text in my input box?
Step 1: Ensure you're logged in with the Google account under which you created your Google Maps API key. Step 2: Navigate to Google Console Credentials screen and click to your API key to enter it. Step 3: In API restrictions section choose 'Restrict key' and click on 'Select APIs' dropdown.
The autocomplete request is available at no charge, and the subsequent Place Details call gets charged based on regular Place Details pricing. A Place Details request generates Data SKUs (Basic, Contact, and/or Atmosphere) – depending on the fields that are specified in the request.
You can refresh Place IDs at no charge, by making a Place Details request, specifying only the place_id field in the fields parameter. This will trigger the Places Details - ID Refresh SKU. However, this request might also return NOT_FOUND status code.
Google Places API pricing and limitsThere are 1,000 free Places API lookups per 24 hours but you can increase them to 150,000 free lookups for 24 hours by Enabling Billing in Google Cloud Console.
You have just to add in your input html: placeholder=""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With