Search Results

Search found 101 results on 5 pages for 'geocode'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • count specific values in a multidimensional array

    - by user1680701
    I have an odd set of arrays that I need to count how many times specific values show in the results. Currently I have this bit of code. $nested_arrays = shopp_orders( '2011-11-30 00:00:00', '2012-11-30 12:59:59', false, '', 2 ); print_r($nested_arrays); This code pulls multiple arrays (serialized data) from the database and outputs like this Array ( [30] => Purchase Object ( [purchased] => Array ( ) [columns] => Array ( ) [message] => Array ( ) [data] => Array ( ) [invoiced] => [authorized] => [captured] => [refunded] => [voided] => [balance] => 0 [downloads] => [shipable] => [shipped] => [stocked] => [_position:DatabaseObject:private] => 0 [_properties:DatabaseObject:private] => Array ( ) [_ignores:DatabaseObject:private] => Array ( [0] => _ ) [_map:protected] => Array ( ) [_table] => wp_shopp_demo_shopp_purchase [_key] => id [_datatypes] => Array ( [id] => int [customer] => int [shipping] => int [billing] => int [currency] => int [ip] => string [firstname] => string [lastname] => string [email] => string [phone] => string [company] => string [card] => string [cardtype] => string [cardexpires] => date [cardholder] => string [address] => string [xaddress] => string [city] => string [state] => string [country] => string [postcode] => string [shipname] => string [shipaddress] => string [shipxaddress] => string [shipcity] => string [shipstate] => string [shipcountry] => string [shippostcode] => string [geocode] => string [promos] => string [subtotal] => float [freight] => float [tax] => float [total] => float [discount] => float [fees] => float [taxing] => list [txnid] => string [txnstatus] => string [gateway] => string [paymethod] => string [shipmethod] => string [shipoption] => string [status] => int [data] => string [secured] => string [created] => date [modified] => date ) [_lists] => Array ( [taxing] => Array ( [0] => exclusive [1] => inclusive ) ) [id] => 30 [customer] => 12 [shipping] => 23 [billing] => 23 [currency] => 0 [ip] => 24.125.58.205 [firstname] => test [lastname] => test [email] => [email protected] [phone] => 1234567890 [company] => [card] => 1111 [cardtype] => Visa [cardexpires] => 1420070400 [cardholder] => test [address] => 123 Any Street [xaddress] => [city] => Danville [state] => VA [country] => US [postcode] => 24541 [shipname] => [shipaddress] => 123 Any Street [shipxaddress] => [shipcity] => Danville [shipstate] => VA [shipcountry] => US [shippostcode] => 24541 [geocode] => [promos] => Array ( ) [subtotal] => 49.37 [freight] => 9.98 [tax] => 9.874 [total] => 69.22 [discount] => 0 [fees] => 0 [taxing] => exclusive [txnid] => [txnstatus] => authed [gateway] => TestMode [paymethod] => credit-card-test-mode [shipmethod] => ItemRates-0 [shipoption] => Fast Shipping [status] => 0 [secured] => [created] => 1354096946 [modified] => 1354096946 ) [29] => Purchase Object ( [purchased] => Array ( ) [columns] => Array ( ) [message] => Array ( ) [data] => Array ( ) [invoiced] => [authorized] => [captured] => [refunded] => [voided] => [balance] => 0 [downloads] => [shipable] => [shipped] => [stocked] => [_position:DatabaseObject:private] => 0 [_properties:DatabaseObject:private] => Array ( ) [_ignores:DatabaseObject:private] => Array ( [0] => _ ) [_map:protected] => Array ( ) [_table] => wp_shopp_demo_shopp_purchase [_key] => id [_datatypes] => Array ( [id] => int [customer] => int [shipping] => int [billing] => int [currency] => int [ip] => string [firstname] => string [lastname] => string [email] => string [phone] => string [company] => string [card] => string [cardtype] => string [cardexpires] => date [cardholder] => string [address] => string [xaddress] => string [city] => string [state] => string [country] => string [postcode] => string [shipname] => string [shipaddress] => string [shipxaddress] => string [shipcity] => string [shipstate] => string [shipcountry] => string [shippostcode] => string [geocode] => string [promos] => string [subtotal] => float [freight] => float [tax] => float [total] => float [discount] => float [fees] => float [taxing] => list [txnid] => string [txnstatus] => string [gateway] => string [paymethod] => string [shipmethod] => string [shipoption] => string [status] => int [data] => string [secured] => string [created] => date [modified] => date ) [_lists] => Array ( [taxing] => Array ( [0] => exclusive [1] => inclusive ) ) [id] => 29 [customer] => 13 [shipping] => 26 [billing] => 25 [currency] => 0 [ip] => 70.176.223.40 [firstname] => Bryan [lastname] => Crawford [email] => [email protected] [phone] => 4802323049 [company] => ggg [card] => 1111 [cardtype] => Visa [cardexpires] => 1356998400 [cardholder] => ggg [address] => 1300 W Warner Rd [xaddress] => [city] => Gilbert [state] => AZ [country] => US [postcode] => 85224 [shipname] => [shipaddress] => 1300 W Warner Rd [shipxaddress] => [shipcity] => Gilbert [shipstate] => AZ [shipcountry] => US [shippostcode] => 85224 [geocode] => [promos] => Array ( ) [subtotal] => 29.95 [freight] => 9.98 [tax] => 0 [total] => 39.93 [discount] => 0 [fees] => 0 [taxing] => exclusive [txnid] => [txnstatus] => authed [gateway] => TestMode [paymethod] => credit-card-test-mode [shipmethod] => ItemRates-0 [shipoption] => Fast Shipping [status] => 0 [secured] => [created] => 1353538691 [modified] => 1353538691 ) ) This is order data from only two orders. I need to count how many times each state, each city, shipmethod, etc occur in the array. I tried the following but it only counted the 2 large arrays. function count_nested_array_keys(array &$a, array &$res=array()) { $i = 0; foreach ($a as $key=>$value) { if (is_array($value)) { $i += count_nested_array_keys($value, &$res); } else { if(!isset($res[$key])) $res[$key] = 0; $res[$key]++; $i++; } } return $i; } $total_item_count = count_nested_array_keys($nested_arrays, $count_per_key); echo "count per key: ", print_r($count_per_key), "\n"; If someone could show me how to count how many times each state value occurs, example, VA = 2 NC = 1 I can take it from there. Thank You.

    Read the article

  • GEO Tool - commercial use

    - by Jens
    what i want to do: offer my clients the possibility to display their store as a small graphic (like google maps). just a small png with the location of the store. only the specific client is able to see this images and he pays for this area (not only for that :) ). So i'm looking for a api or whatever else to geocode(?) the adress and render a small (280*160px) image. google offers a premium licence (not cheap) ms bing openstreetmap - i'm not able to understand the 10^10 licences ;( any ideas?

    Read the article

  • what does calling ´this´ outside of a jquery plugin refer to

    - by Richard
    Hi, I am using the liveTwitter plugin The problem is that I need to stop the plugin from hitting the Twitter api. According to the documentation I need to do this $("#tab1 .container_twitter_status").each(function(){ this.twitter.stop(); }); Already, the each does not make sense on an id and what does this refer to? Anyway, I get an undefined error. I will paste the plugin code and hope it makes sense to somebody MY only problem thusfar with this plugin is that I need to be able to stop it. thanks in advance, Richard /* * jQuery LiveTwitter 1.5.0 * - Live updating Twitter plugin for jQuery * * Copyright (c) 2009-2010 Inge Jørgensen (elektronaut.no) * Licensed under the MIT license (MIT-LICENSE.txt) * * $Date: 2010/05/30$ */ /* * Usage example: * $("#twitterSearch").liveTwitter('bacon', {limit: 10, rate: 15000}); */ (function($){ if(!$.fn.reverse){ $.fn.reverse = function() { return this.pushStack(this.get().reverse(), arguments); }; } $.fn.liveTwitter = function(query, options, callback){ var domNode = this; $(this).each(function(){ var settings = {}; // Handle changing of options if(this.twitter) { settings = jQuery.extend(this.twitter.settings, options); this.twitter.settings = settings; if(query) { this.twitter.query = query; } this.twitter.limit = settings.limit; this.twitter.mode = settings.mode; if(this.twitter.interval){ this.twitter.refresh(); } if(callback){ this.twitter.callback = callback; } // ..or create a new twitter object } else { // Extend settings with the defaults settings = jQuery.extend({ mode: 'search', // Mode, valid options are: 'search', 'user_timeline' rate: 15000, // Refresh rate in ms limit: 10, // Limit number of results refresh: true }, options); // Default setting for showAuthor if not provided if(typeof settings.showAuthor == "undefined"){ settings.showAuthor = (settings.mode == 'user_timeline') ? false : true; } // Set up a dummy function for the Twitter API callback if(!window.twitter_callback){ window.twitter_callback = function(){return true;}; } this.twitter = { settings: settings, query: query, limit: settings.limit, mode: settings.mode, interval: false, container: this, lastTimeStamp: 0, callback: callback, // Convert the time stamp to a more human readable format relativeTime: function(timeString){ var parsedDate = Date.parse(timeString); var delta = (Date.parse(Date()) - parsedDate) / 1000; var r = ''; if (delta < 60) { r = delta + ' seconds ago'; } else if(delta < 120) { r = 'a minute ago'; } else if(delta < (45*60)) { r = (parseInt(delta / 60, 10)).toString() + ' minutes ago'; } else if(delta < (90*60)) { r = 'an hour ago'; } else if(delta < (24*60*60)) { r = '' + (parseInt(delta / 3600, 10)).toString() + ' hours ago'; } else if(delta < (48*60*60)) { r = 'a day ago'; } else { r = (parseInt(delta / 86400, 10)).toString() + ' days ago'; } return r; }, // Update the timestamps in realtime refreshTime: function() { var twitter = this; $(twitter.container).find('span.time').each(function(){ $(this).html(twitter.relativeTime(this.timeStamp)); }); }, // Handle reloading refresh: function(initialize){ var twitter = this; if(this.settings.refresh || initialize) { var url = ''; var params = {}; if(twitter.mode == 'search'){ params.q = this.query; if(this.settings.geocode){ params.geocode = this.settings.geocode; } if(this.settings.lang){ params.lang = this.settings.lang; } if(this.settings.rpp){ params.rpp = this.settings.rpp; } else { params.rpp = this.settings.limit; } // Convert params to string var paramsString = []; for(var param in params){ if(params.hasOwnProperty(param)){ paramsString[paramsString.length] = param + '=' + encodeURIComponent(params[param]); } } paramsString = paramsString.join("&"); url = "http://search.twitter.com/search.json?"+paramsString+"&callback=?"; } else if(twitter.mode == 'user_timeline') { url = "http://api.twitter.com/1/statuses/user_timeline/"+encodeURIComponent(this.query)+".json?count="+twitter.limit+"&callback=?"; } else if(twitter.mode == 'list') { var username = encodeURIComponent(this.query.user); var listname = encodeURIComponent(this.query.list); url = "http://api.twitter.com/1/"+username+"/lists/"+listname+"/statuses.json?per_page="+twitter.limit+"&callback=?"; } $.getJSON(url, function(json) { var results = null; if(twitter.mode == 'search'){ results = json.results; } else { results = json; } var newTweets = 0; $(results).reverse().each(function(){ var screen_name = ''; var profile_image_url = ''; if(twitter.mode == 'search') { screen_name = this.from_user; profile_image_url = this.profile_image_url; created_at_date = this.created_at; } else { screen_name = this.user.screen_name; profile_image_url = this.user.profile_image_url; // Fix for IE created_at_date = this.created_at.replace(/^(\w+)\s(\w+)\s(\d+)(.*)(\s\d+)$/, "$1, $3 $2$5$4"); } var userInfo = this.user; var linkified_text = this.text.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(m) { return m.link(m); }); linkified_text = linkified_text.replace(/@[A-Za-z0-9_]+/g, function(u){return u.link('http://twitter.com/'+u.replace(/^@/,''));}); linkified_text = linkified_text.replace(/#[A-Za-z0-9_\-]+/g, function(u){return u.link('http://search.twitter.com/search?q='+u.replace(/^#/,'%23'));}); if(!twitter.settings.filter || twitter.settings.filter(this)) { if(Date.parse(created_at_date) > twitter.lastTimeStamp) { newTweets += 1; var tweetHTML = '<div class="tweet tweet-'+this.id+'">'; if(twitter.settings.showAuthor) { tweetHTML += '<img width="24" height="24" src="'+profile_image_url+'" />' + '<p class="text"><span class="username"><a href="http://twitter.com/'+screen_name+'">'+screen_name+'</a>:</span> '; } else { tweetHTML += '<p class="text"> '; } tweetHTML += linkified_text + ' <span class="time">'+twitter.relativeTime(created_at_date)+'</span>' + '</p>' + '</div>'; $(twitter.container).prepend(tweetHTML); var timeStamp = created_at_date; $(twitter.container).find('span.time:first').each(function(){ this.timeStamp = timeStamp; }); if(!initialize) { $(twitter.container).find('.tweet-'+this.id).hide().fadeIn(); } twitter.lastTimeStamp = Date.parse(created_at_date); } } }); if(newTweets > 0) { // Limit number of entries $(twitter.container).find('div.tweet:gt('+(twitter.limit-1)+')').remove(); // Run callback if(twitter.callback){ twitter.callback(domNode, newTweets); } // Trigger event $(domNode).trigger('tweets'); } }); } }, start: function(){ var twitter = this; if(!this.interval){ this.interval = setInterval(function(){twitter.refresh();}, twitter.settings.rate); this.refresh(true); } }, stop: function(){ if(this.interval){ clearInterval(this.interval); this.interval = false; } } }; var twitter = this.twitter; this.timeInterval = setInterval(function(){twitter.refreshTime();}, 5000); this.twitter.start(); } }); return this; }; })(jQuery);

    Read the article

  • iPhone - access location information from a photo.

    - by bpapa
    Is it possible, in an iPhone app, to extract location information (geocode, I suppose it's called) from a photo taken with the iPhone camera? If there is no API call to do it, is there any known way to parse the bytes of data to extract the information? Something I can roll on my own?

    Read the article

  • How do I mock an object in this case? no obvious way to replace object with mock

    - by Tristan
    Hi there, Suppose I have this very simple method in Store's model: def geocode_address loc = Store.geocode(address) self.lat = loc.lat self.lng = loc.lng end If I want to write some test scripts that aren't affected by the geocoding service, which may be down, have limitations or depend on my internet connection, how do I mock out the geocoding service? If I could pass a geocoding object into the method, it would be easy, but I don't see how I could do it in this case. Thanks! Tristan

    Read the article

  • parsing xml data from a google api

    - by pankaj
    Hi, i have a google map link which returns a xml to me. I want values of a specific tag from that xml. can some one suggest me how will i do it. Link: http://maps.google.com/maps/api/geocode/xml?address=1270 Broadway Ste 803, New York, NY 10001, USA&sensor=false

    Read the article

  • Geocoding Chinese addresses using Google Maps API in Python?

    - by Jack Low
    I have looked into Geopy and googlemaps (http://py-googlemaps.sourceforge.net/) and they both do not work for Chinese addresses. My app is stored on the Google App Engine. What I want to do is to parse a file containing addresses of restaurants in Hong Kong, and then Geocode the addresses and store the Lat and Lng in the datastore. How do I do this?

    Read the article

  • manipulating the geocoding webservices results through javascript?

    - by hao
    using http://maps.google.com/maps/api/geocode/json?address=xyz we get a json file I am wondering how can i maniupluate the results in javascript? How do i create the results object in javascript? http://code.google.com/apis/maps/documentation/geocoding/index.html#JSONParsing this doesnt really explain how they get the myJSONResult

    Read the article

  • Get latlng and draw a polyline between that two latlng

    - by anup sharma
    I have some issue in my code in that first I want to get latlng of my given address/city name from two text boxes after that i converts it to from position's latlng and to position's latlng and at last i want to draw a polyline between these point and markers on both point also, But now i am trying to draw a line between these points. But still not working this code also no any error in console also. code is here for your help. function getRoute(){ var from_text = document.getElementById("travelFrom").value; var to_text = document.getElementById("travelTo").value; if(from_text == ""){ alert("Enter travel from field") document.getElementById("travelFrom").focus(); } else if(to_text == ""){ alert("Enter travel to field"); document.getElementById("travelTo").focus(); } else{ //google.maps.event.addListener(map, "", function (e) { var myLatLng = new google.maps.LatLng(28.6667, 77.2167); var mapOptions = { zoom: 3, center: myLatLng, mapTypeId: google.maps.MapTypeId.TERRAIN }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var geocoder = new google.maps.Geocoder(); var address1 = from_text; var address2 = to_text; var from_latlng,to_latlng; //var prepath = path; //if(prepath){ // prepath.setMap(null); //} geocoder.geocode( { 'address': address1}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { // do something with the geocoded result // alert(results[0].geometry.location); from_latlng = results[0].geometry.location; // from_lat = results[0].geometry.location.latitude; // from_lng = results[0].geometry.location.longitude; // alert(from_latlng); } }); geocoder.geocode( { 'address': address2}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { // do something with the geocoded result to_latlng = results[0].geometry.location; // to_lat = results[0].geometry.location.latitude; // to_lng = results[0].geometry.location.longitude; // results[0].geometry.location.longitude // alert(to_latlng) } }); setTimeout(function(){ var flightPlanCoordinates = [ new google.maps.LatLng(from_latlng), new google.maps.LatLng(to_latlng) ]; //alert("123") var polyline; polyline = new google.maps.Polyline({ path: flightPlanCoordinates, strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2 }); polyline.setMap(map); // assign to global var path // path = polyline; },4000); // }); } }

    Read the article

  • Twitter Search API is returning weird characters - is it more or is it them?

    - by DanSingerman
    We are building an app that accesses the Twitter search over JSONP. It mostly works fine, but occasionally the request returns a JSONP callback that exists of weird unparseable characters. Here is an example: http://search.twitter.com/search.json?result_type=recent&rpp=100&geocode=51.4375857,-0.1658648,1km&page=5&callback=jsonp1272532482854 (If you change page=5 to a value less than 5 in the URL it works fine) So Am I doing something wrong? Can anyone suggest a workaround?

    Read the article

  • How to properly pass address to google geocoding service

    - by clinisbut
    I'm getting some problems trying Google Geocoding service when using special characters like "º" or letters with accents. Whenever I try something like: "barcelona, nº 10" I get 0 results. But trying: "barcelona n 10" I get results... I suspect is something related with encoding. I tried this: geocoder.geocode({'address': encodeURI( $('#direction').val() )}, function(){} ); But didn't help. Any Idea?

    Read the article

  • is it possible to change the query parameters in REST API from script editor in SOAPUI?

    - by user1518659
    i am doing load test on this REST API using SOAPUI. http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false i ve successfully setup the testsuite and all. my doubt is is it possible to change the query parameters in the REST API url by passing values from the script editor(either javascript or groovy) for the test suite when i perform test? if so, how should i write the script? Hope I am clear with my ques.

    Read the article

  • Google maps api v3: geocoding multiple addresses and infowindow

    - by user2536786
    I am trying to get infowindow for multiple addresses. Its creating markers but when I click on markers, infowindow is not popping up. Please help and see what could be wrong in this code. Rest all info is fine only issue is with infowindow not coming up. <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Google Maps Multiple Markers</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="height: 800px;"></div> <script type="text/javascript"> var locations = [ ['Bondi Beach', '850 Bay st 04 Toronto, Ont'], ['Coogee Beach', '932 Bay Street, Toronto, ON M5S 1B1'], ['Cronulla Beach', '61 Town Centre Court, Toronto, ON M1P'], ['Manly Beach', '832 Bay Street, Toronto, ON M5S 1B1'], ['Maroubra Beach', '606 New Toronto Street, Toronto, ON M8V 2E8'] ]; var map = new google.maps.Map(document.getElementById('map'), { zoom: 10, center: new google.maps.LatLng(43.253205,-80.480347), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var geocoder = new google.maps.Geocoder(); var marker, i; for (i = 0; i < locations.length; i++) { geocoder.geocode( { 'address': locations[i][1]}, function(results, status) { //alert(status); if (status == google.maps.GeocoderStatus.OK) { //alert(results[0].geometry.location); map.setCenter(results[0].geometry.location); marker = new google.maps.Marker({ position: results[0].geometry.location, map: map }); google.maps.event.addListener(marker, 'mouseover', function() { infowindow.open(marker, map);}); google.maps.event.addListener(marker, 'mouseout', function() { infowindow.close();}); } else { alert("some problem in geocode" + status); } }); } </script> </body> </html>

    Read the article

  • fitbounds() in Google maps api V3 does not fit bounds

    - by jul
    hi, I'm using the geocoder from Google API v3 to display a map of a country. I get the recommended viewport for the country but when I want to fit the map to this viewport, it does not work (see the bounds before and after calling the fitBounds function in the code below). What am I doing wrong? How can I set the viewport of my map to results[0].geometry.viewport? thanks jul var geocoder = new google.maps.Geocoder(); if(geocoder) { geocoder.geocode({'address': '{{countrycode}}'}, function(results, status) { var bounds = new google.maps.LatLngBounds(); bounds = results[0].geometry.viewport; console.log(bounds); //((35.173, -12.524), (45.244, 5.098)) console.log(map.getBounds()); //((34.628757195038844, -14.683750000000012), (58.28355197864712, 27.503749999999986)) map.fitBounds(bounds); console.log(map.getBounds()); //((25.740113512090183, -24.806750000000005), (52.44233664523719, 17.380749999999974)) }); } }

    Read the article

  • How to geocoding big number of addresses?

    - by user308569
    I need to geocode, i.e. translate street address to latitude,longitude for ~8,000 street addresses. I am using both Yahoo and Google geocoding engines at http://www.gpsvisualizer.com/geocoder/, and found out that for a big number of addresses those engines (one of them or both) either could not perform geocoding (i.e.return latitude=0,longitude=0), or return wrong coordinates (incl. cases when Yahoo and Google give different results). What is the best way to handle this problem? Which engine is (usually) more accurate? I would appreciate any thoughts, suggestions, ideas from people who had previous experience with this kind of task.

    Read the article

  • Google Maps geocoding (address to GLatLng)

    - by antosha
    Hi, I am trying to draw a geodesic polyline with Google Maps JavaScript API from two address points. <script type="text/javascript">// <![CDATA[ var polyOptions = {geodesic:true}; var polyline = new GPolyline([ new GLatLng(), new GLatLng() ], "#f36c25", 5, 0.8, polyOptions); map.addOverlay(polyline); if (GBrowserIsCompatible()) { map.addOverlay(polyline); } // ]]></script> Could someone tell me how can I dynamically geocode an address into GLatLng coordinates? (I am a little confused after reading Google's API documentation http://code.google.com/apis/maps/documentation/javascript/v2/services.html) Thanks :)

    Read the article

  • Easy to implement .net library for geocoding using a free service?

    - by Kjensen
    I need to geocode adresses (get lat/long from addresses) using in .Net, to store in the database. What is the library/project to look into, to get that done? After a search here, on google and codeplex.com, I have found there to be a few options, that seem like they will do what I ask for... But some of them could be crap and a waste of time - and some might just be stellar. Which one is the one to go for? Have you used any of them?

    Read the article

  • Address component type in google maps geocoding

    - by user552828
    this is a part of my geocoding code. I want it to show only country of the selected place, but it shows all address components, My problem is I cant specify the address components object. There is a way of doing it that is written on documentation but I didnt understand, can you do it for me. if (geocoder) { geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var str = ""; $.each(results, function(){ str += "address components: <ul>" $.each(this.address_components, function(){ str +="<li>"+this.types.join(", ")+": "+this.long_name+"</li>"; }); str +="</ul>"; }); $("#geocode_info").html(str);

    Read the article

  • Geocoding autocomplete bias not working

    - by chris
    I'm using the following code to get the autocomplete functionality for an address input box using Google Maps API v3: function initializeAutocomplete() { var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(1.484016,103.575212), new google.maps.LatLng(1.233592,104.033618)); var input = document.getElementById('destStreet'); var myOptions = {bounds: defaultBounds, types: ['geocode']}; autocomplete = new google.maps.places.Autocomplete(input, myOptions); } The problem is that biasing doesn't seem to work as the first results are usually not relevant to the defined bounds (a country). I've seen a few apps working fine, so I'm wondering where the problem is. I came across the JQuery autocomplete plugin (http://code.google.com/p/geo-autocomplete/) which would seem like a good alternative since it has a region filter, but I'm unable to "install it" or use it because of my very limited knowledge (I learn by example). Could you please help me getting more relevant results with the above code or guide me through the implementation of the JQuery alternative? Of course I'm very open to other suggestions as well.

    Read the article

  • Jquery show() not working in FF

    - by Andrea Zironda
    I have issues with FF & Jquery .show(). my website shows an embedded map from google in clicking a link.i have got a javascript function that handle this, in safari it works great.FF won't show the map. this is the js. function: function mostraPagina(nome){ if (nome='mappa'){ $('#mappa').load('contenuti/mappe/mappa_thiene.html'); $('#dark_background').show(600); $('#mappa').show(600); } } the embedded code from google maps is: <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Via+Murialdo,+4,+Thiene+italy&amp;sll=45.710686,11.475665&amp;sspn=0.002439,0.005676&amp;ie=UTF8&amp;hq=&amp;hnear=Via+Murialdo,+4,+36016+Thiene+Vicenza,+Veneto,+Italy&amp;ll=45.710222,11.475618&amp;spn=0.001219,0.002838&amp;t=h&amp;z=14&amp;output=embed"></iframe> thank you very much.

    Read the article

  • Google Maps custom marker - can the iframe accept one like the static maps?

    - by alex
    I was reading the static maps API, and it says you can include a custom marker in the GET params. You simply link to an image file. I now have a second Google Map within an iframe, and was wondering if you can attach custom markers via the GET params to it? Here is the src attribute of the iframe currently. http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=111+Fake+Street+Noosaville+Queensland+Australia&ie=UTF8&output=embed I can't seem to find the documentation on how to do this, if possible. Is this possible?

    Read the article

  • Cannot set focus on input field in infoWindow

    - by thomas
    Hi Why is focus not set to noteTitle? I am using google maps API V3. The getNoteForm() returns a input field "noteTitle". The $("#noteTitle").focus() works fine when executed in firebug. I call this function when clicking on the map: function setNewNoteInfowindow(latlng) { if (geocoder) { geocoder.geocode({'latLng': latlng}, function(results, status) { var address = ""; if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { address = results[1].formatted_address; } } newNoteInfowindow = new google.maps.InfoWindow({ content: getNoteForm(latlng, address), size: new google.maps.Size(40,50) }); newNoteInfowindow.open(map, newNoteMarker); google.maps.event.addListener(newNoteInfowindow, 'domready', function() { $("#noteTitle").focus(); }); google.maps.event.addListener(newNoteInfowindow, 'closeclick', function() { newNoteMarker.setVisible(false); }); }); } }

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >