PDA

View Full Version : map widget


heretoo
10-15-2008, 01:04 PM
Does anyone know how to code a small widget that allow users to type in address and get the direct URL of Google.com direction page for that address. Also add image button. If you can, I'll give you credit. :cool
Like this
________________________
Enter Full Address
Address: | box for entering |
City: | box for entering |
State: | box for entering |
Zip: |box for entering |
Button Build Map Link (Appears below a line stays within widget not another page.)
________________________
Your Url link is available.
Copy Paste. Thank you.

| box showing URL link in format <a href="link"><img src="http://www.domain.com/images/mapbutton.gif" alt="Get directions NOW!"></a> |
________________________

Bruce
10-15-2008, 04:24 PM
button on page one:
--Reads the the address.txt from this home and reads it into a table.
table = TextFile.ReadToTable("AutoPlay\\houses\\house1\\address.txt");


houseinfo = TextFile.ReadToString("AutoPlay\\houses\\house1\\info.txt");
strHouse = "house1"
Page.Jump("page2");



button on page two:
--Checks to see if the end user is on line.
connected = HTTP.TestConnection("http://www.indigorose.com", 20, 80, nil, nil);
if connected then
--Insert your internet related action here
else
Dialog.Message("Internet Error", "Sorry, You are not connected to the internet. You will not be able to view this map until you are connected.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

end


table[1] = String.Replace (table[1], " ", "+")
table[2] = String.Replace (table[2], " ", "+")
File.OpenURL("http://maps.yahoo.com/maps_result?addr=" .. table[1] .. "&csz=" .. table[2] .. "&country=us&new=1&name=&qty=");

RizlaUK
10-20-2008, 03:35 AM
hey, thats pretty cool, i can work that into an app im making

Bruce
10-20-2008, 08:22 AM
hey, thats pretty cool, i can work that into an app im making

Any time I can help u Riza, that's gotta be good. ;)

heretoo
10-22-2008, 05:08 AM
Do I need address.txt and info.txt file with 777 permissions?
What will be best code line to call for the address.apz on the page?
Very nice widget, love it. Thanks. :cool:) :)

abnrange
10-22-2008, 09:12 AM
Thanks for the example.

Is it possible to enter the address into an input object - click a save button, it would then save the txt file with address name and populate into a combobox. On combobox click it would load the address from the text file and load yahoo maps?

abnrange
10-22-2008, 06:23 PM
Hello all - I made a few changes to this project but, got stuck with some code. Can someon eplease help? Thanks See attached

jassing
10-23-2008, 03:31 AM
what help do you want? what problems are you running in to?

abnrange
10-23-2008, 05:57 AM
Sorry - I posted the question in the app on the first page.

Basically I want to have an input object that I can type the address into and a save button that will save the text as the 1st line of the address (1566Goodwin Ave). This way we can store address and populate them in the combo - On select of address it would then load in a web object. I got the combobox to somewhat work - Could not get it to save as the address line or get it into a web object. Thanks

jassing
10-23-2008, 06:23 AM
Like the attached?

I suspect your wanting to do "more"; but it does what you're asking..

abnrange
10-23-2008, 06:29 AM
Thanks for the quick reply -

Yes - Currently the file is deleted. I want to be able to save the txt files and have them populate everytime the app is opened. - Also would like to get Map It to load into a web object. Is that possible? Thanks again

jassing
10-23-2008, 06:38 AM
Thanks for the quick reply -

Yes - Currently the file is deleted. I want to be able to save the txt files and have them populate everytime the app is opened. - Also would like to get Map It to load into a web object. Is that possible? Thanks again

So you'll need to create unique names for the .txt files (personally; I'd use an sqlite database...) and scan them on startup.

you mean you would like the page to open "in" ams, instead of an external browser? Have you tried using the web object?

abnrange
10-23-2008, 06:47 AM
Thanks again for the quick reply.

I don't know much about SQL or even where to start to make it work.

Yes, I would like the page to open within AMS if possible!

Thanks again

jassing
10-23-2008, 06:56 AM
Then you're probably better off using unique names in a specific folder you can scan (File.Find()) and load into your combo box.

To view the page w/in AMS -- use the web object.

-josh

btw: You'd probably get better responses by posting your questions in the AMS specific forum.

abnrange
10-23-2008, 06:59 AM
I must have accidentally psoted in the wrong forum. I think this thread is also under AMS 7.5.

I did try the web object with saving unquie name but failed to make it work.

Thanks for your help

jassing
10-23-2008, 07:09 AM
post what you did with the webobject & how you used unique names to save -- I may be able to help...

abnrange
10-23-2008, 07:22 AM
Thanks -I posted under AMS "Address Help"

compel04
12-09-2008, 07:11 PM
hi. can someone help me make a back groung image change every month
I'm new and trying to create a program that will change the image about
every thirty days or the 1st of each month.
thank you in advance whoever can help me.

Compel08::)

jassing
12-09-2008, 08:01 PM
change in topic should warrant a new thread -- post your question in a new topic...