Git Product home page Git Product logo

Comments (4)

sgruhier avatar sgruhier commented on July 16, 2024

I dont understand, map is centered on lat/lng you set. regionBias is used for geocoding

    setPosition(new google.maps.LatLng(this.lat.val(), this.lng.val())

Could you share your code

from jquery-addresspicker.

mellterm avatar mellterm commented on July 16, 2024

I meant more its initial position before the user enters an address and sets the position..
Initially, regionBias is set to "fr" in your code. I tried to change it here to "uk" or "us" but the map still initialized on France.

$(function() {
        var addresspickerMap = $( "#addresspicker_map" ).addresspicker({
                                                            regionBias: "fr",
                                                            elements: {
                                                            map: "#map",
                                                            lat: "#location_latitude",
                                                            lng: "#location_longitude",
                                                            locality: '#location_locality',
                                                            country: '#location_country'
                                                            }
}); 
    var gmarker = addresspickerMap.addresspicker( "marker");
    gmarker.setVisible(true);
    addresspickerMap.addresspicker( "updatePosition");
});

from jquery-addresspicker.

sgruhier avatar sgruhier commented on July 16, 2024

you have 2 options:

  • set lat / lng in your html input of id #location_latitude and #location_longitude
  • set mapOptions to any value you want:
var addresspickerMap = $( "#addresspicker_map" ).addresspicker({
  regionBias: "fr",
  mapOptions: {
      zoom: 5, 
      center: new google.maps.LatLng(46, 2), 
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
  },
  elements: {
    map: "#map",
    lat: "#location_latitude",
    lng: "#location_longitude",
    locality: '#location_locality',
    country: '#location_country'
  }
});

from jquery-addresspicker.

 avatar commented on July 16, 2024

For future reference for others the setting in the map options to center on the USA is: center: new google.maps.LatLng(40.4230, -98.7372),

from jquery-addresspicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.