Skip to content

Autocomplete cannot select city/suburb (i.e. broad area) #69

Closed
@bwenstar

Description

@bwenstar

Hello,

As the title states, I have implemented functionality similar to the 'Subscribing for Events' example seen on this page (http://logicify.github.io/jquery-locationpicker-plugin/#usage).

When I select a city as a location, for example 'Sydney, New South Wales, Australia' it autocompletes to '343 George St, Sydney NSW 2000, Australia'.

However the example that Google supplies allows you to select a city as a location rather than a specific address. (https://developers.google.com/maps/documentation/javascript/examples/places-searchbox).

Is there something I'm missing to fix this issue?

    $(document).ready(function() {
        $('#map').locationpicker({
            location: {latitude: -27.4732212, longitude: 153.02787250000006},   
            radius: 1,
            inputBinding: {
                latitudeInput: $('#us2-lat'),
                longitudeInput: $('#us2-lon'),

                locationNameInput: $('#us2-address')
            },
                enableAutocomplete: true,
                onchanged: function (currentLocation, radius, isMarkerDropped) {
                    // Uncomment line below to show alert on each Location Changed event
                    //alert("Location changed. New location (" + currentLocation.latitude + ", " + currentLocation.longitude + ")");
                }
        });
    });

Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions