Solved

Google XML Issue - Results not working as expected...

Posted on 2012-03-27
14
590 Views
Last Modified: 2013-12-25
Hello,

I have created a web page that returns a list of locations from Google Maps, when there are more than one result found, however when clicking on one of the results to confirm which I want, it doesn't seem to listen and simply reloads the page.  I have tried to alter the 'h ref' and direct the click straight to the confirmation page, however this unfortunately stops any of the code showing on the page, which is really strange...!

The HTML generated is:

<?xml version="1.0" encoding="ISO-8859-1"?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-32" />
<title>Searching Address</title>
</head>
<body>
<form name="form1" method="post">
Fürth, GermanyThe address you requested returned multiple possibilities:<p><p><a href="searchaddress.asp?address=Fürth, Germany">Fürth, Germany</a></p><p><a href="searchaddress.asp?address=Furth, Germany">Furth, Germany</a></p><p><a href="searchaddress.asp?address=Furth im Wald, Germany">Furth im Wald, Germany</a></p><p><a href="searchaddress.asp?address=Fürth, Germany">Fürth, Germany</a></p></p><P>If the address is not listed, please try again, perhaps adding in more information:<p> <input type="text" size="50" name="address" id="address" value="Fürth, Germany" /><input type="submit" id="searchagain" name="searchagain" value="Search Again" /></p>

</form>
</body>
</html>

I have attached the ASP page here too.

Thanks for your help!
0
Comment
Question by:Nico2011
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
14 Comments
 
LVL 22

Expert Comment

by:Kim Walker
ID: 37771037
Could it be the spaces in your query string? Try url encoding the href.
0
 

Author Comment

by:Nico2011
ID: 37771235
Thanks but that doesn't work either...
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 37771285
Does the file "searchaddress.asp" have code to process the query string? You said you attached the asp page but I don't see an attachment.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:Nico2011
ID: 37771329
Aha - I'm to EE, so didn't see the 'Attach' button after browsing - should have known better...!  Attached now!  

Yes, there is some code, but a redirect.  It's really strange because as soon as the page name is changed, the page no longer works at all...!  Essentially, it is sent an addess through a querystring, which it then processes.  If it finds the address first time, then it forwards the user to a page and shows this on a map, but if there are more than one result found for the location (such as furth in Germany) it loops back on itself.  Sometimes however, if there is a larger list of results, it will work - as in takes the address te user has clicked on as the correct one, and passes it to the next page with the map.

Thanks again!
searchaddress.txt
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 37771482
Unfortunately, it's been ten years or more since I last looked at ASP. I got involved in this question because JavaScript was listed as one of the topics. Perhaps an ASP expert will join in, but you may have to repost the question with a different title that will attract ASP experts.

From what I've been able to understand from your code and my experience with Google maps, I'm wondering if the addresses listed will always return multiple possibilities. Have you tried searching for one of the alternatives first? Does it still return multiple addresses? If so, you may have to include more than just the address in your secondary searches.

In your initial post, it appears you have started a search for "Fürth, Germany" and received four possibilities. However, the first and last possibility are exactly the same as the initial search. Clicking either of those choices will repeat the exact same process again since the query string for both is exactly the same as the initial request, "Fürth, Germany".
0
 

Author Comment

by:Nico2011
ID: 37771579
Thanks for your help.  I did try to add on the lng/lat to each line, but when I do that, the first record never has that information - the others do...

Yes, sometimes the address gets found and the page bounces straight through to the map page, and it's only when there are multiple possibilities that this problem occurs.

I'll do as you suggest and repost - sorry I put Javascript in the topics - I'm working on so many pages and didn't realise this one doesn't have javascript...!
0
 
LVL 46

Expert Comment

by:aikimark
ID: 37832322
do your links now look like this?
href="searchaddress.asp?address=Fürth,%20Germany"

Open in new window

0
 

Author Comment

by:Nico2011
ID: 37897416
Thanks - no they don't - they look like this: <a href="searchaddress.asp?location=Fürth, Germany">Fürth, Germany</a>

If I try to URL encode the URL, the page stops working altogether...!

(sorry I took so long to come back - I have been away)
0
 
LVL 46

Expert Comment

by:aikimark
ID: 37897551
If you have a search argument that doesn't include any space characters, does the link work?
0
 

Author Comment

by:Nico2011
ID: 37897613
nope - not at all...!  You can see what I'm up to at www.gorgeous-villas.com/index2.asp - try searching for Furth and you'll see the problem I'm having.  Thanks for your help!
0
 
LVL 46

Accepted Solution

by:
aikimark earned 500 total points
ID: 37897831
1. I think you should be using location= rather than address=
2. When you retrieve the data for the combobox, it would be better if you assigned the key value to each entry and do your search by the location key value, instead of the name of the location.
0
 

Author Closing Comment

by:Nico2011
ID: 37901611
That works!  BUT I did have to add in a procedure to prevent the name coming up loads of times - for some reason, Google Maps has the same name with multiple lng/lat addresses.  Most important thing is that it now works - thank you so much.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question