Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

Google Place API Autocomplete

$
0
0

I have a MCV application and there is a field that have to be filled with addresses from google maps.

Searching online I see that I have to use Google Place API but all the example are old, before the usage of the key.

While I was trying something when I boot the project in the console appears

Google Maps JavaScript API error: ApiNotActivatedMapError.

I don't need to display the map and I read that I have to display "powered by gogole" but I dont know how. Can someone help me? thanks

This is the script I write

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js key=YOUR_API_KEY&libraries=places"></script>
<script>
    var input = document.getElementById('Luogo');
    var options = {
        types: ['address']
    };
    autocomplete = new google.maps.places.Autocomplete(input, options);
</script>

And the textbox

@Html.TextBoxFor(m => m.Luogo, new { @form = "form-attivita-edit-" + Model.IdEvoluzione, @style = "width: 120px;" })

Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>