Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var marker = createCustomDataArray();
- var addresspicker = $( "#searchbox" ).addresspicker({
- mapOptions: {
- zoom: 17,
- regionBias: "id",
- center: pos,
- scrollwheel: true,
- mapTypeId: google.maps.MapTypeId.ROADMAP,
- componentRestrictions: { country: "id" },
- types: ['geocode']
- },
- elements: {
- map: "#mapholder",
- lat: "#lat",
- lng: "#lng",
- locality: '#locality',
- country: '#country'
- },
- customData: marker
- })
- $.widget( "ui.addresspicker", {
- options: {
- appendAddressString: "",
- draggableMarker: true,
- regionBias: "id",
- mapOptions: {
- zoom: 12,
- center: new google.maps.LatLng(-5, 106.84517200000005),
- scrollwheel: false,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- },
- elements: {
- map: false,
- lat: false,
- lng: false,
- locality: false,
- country: false,
- type: false
- },
- customData: null
- },
- setCustomData: function(data) {
- this.customData = data;
- return 42;
- },
- _create: function() {
- this.geocoder = new google.maps.Geocoder();
- this.element.autocomplete({
- source: $.proxy(this._geocode, this),
- focus: $.proxy(this._focusAddress, this),
- select: $.proxy(this._selectAddress, this)
- });
- this.lat = $(this.options.elements.lat);
- this.lng = $(this.options.elements.lng);
- this.locality = $(this.options.elements.locality);
- this.country = $(this.options.elements.country);
- this.type = $(this.options.elements.type);
- if (this.options.elements.map) {
- this.mapElement = $(this.options.elements.map);
- this._initMap();
- }
- this.setCustomData(this.options.customData);
- },
Add Comment
Please, Sign In to add comment