The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Create (google)map from the database - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Create (google)map from the database (/showthread.php?tid=685) |
Create (google)map from the database - alexh - May 4th, 2010 I have created a form that accepts addresses and intersections. Has anyone figured out a way call the database info from a google map? The problem I see is that my web form gets an address from the user, but google needs latitude/longitude. I haven't been able to find anything that will parse the address into latitude/longitude and place it into the database. It would be nice to have a module that allows someone map their "views" or filters, all submissions, or individual submissions. Any ideas anyone? -Alex RE: Create (google)map from the database - Ben - May 8th, 2010 Hi Alex, Cool! I'm actually working on something pretty similar right now - I'm adding a section to this site where people can say hello and say where they're using Form Tools. All Google Maps based. This is something I've been meaning to add for... ooh, 4 years? The standard way to do it is have some Ajax code running on page load that calls a PHP page on your site. That PHP file queries the database and returns the info in XML or JSON format, which is then loaded into your map. For the PHP side of things, you'll probably just want to use some custom SQL. I looked over the functions within the API & core code and they're all kind of custom. Plus you really want something fast that runs with no overhead - the existing functions do LOTS of stuff that you probably don't need. However, check out ft_search_submissions() (found in /global/code/submissions.php). It's pretty useful, but it requires figuring out what information to pass it as parameters. Failing that, I'd stick with a simple SQL query to return those results you want. Sorry I couldn't be more help. Good luck with it! - Ben RE: Create (google)map from the database - alexh - May 8th, 2010 (May 8th, 2010, 10:19 AM)Ben Wrote: Hi Alex, Thanks Ben, I think I understand what you are saying. I've been doing a bit of research, and that's pretty much what has been explained to me by everyone else. Have you seen any existing Ajax code out there that does this? I'm pretty good at getting existing scripts working and adjusting them a bit to work with my needs, but starting from scratch is a little overwhelming! This google API stuff is not the easiest to understand though. Keep me updated on what you get going, I'd be curious to see if I can make it work for my application! Thanks again, Alex RE: Create (google)map from the database - prometheus - May 13th, 2010 Howzabout this: http://maps.google.com/maps?q=1600%20Pennsylvania%20Ave%2020500 Just insert a '%20' in each space, and create a string/variable with the address in the format '###StreetHere%20AveStDrEtcHere%20ZipCodeHereIe12345 Pretty slick. Merge in your street address and zipcode after the string 'http://maps.google.com/maps?typeaddresshere' Hope that helps a little bit. ::: p RE: Create (google)map from the database - Ben - May 14th, 2010 And here's a first draft of my own Google Maps script: http://hello.formtools.org/ You can view the JS here: http://hello.formtools.org/global/scripts/maps.js It's NOT very pretty (!!), but it may give you a few ideas. The server side code being loaded via an Ajax request just creates a JSON object containing the website info for showing on the map. As soon as there are lots more websites listed for the map, I'll need to refactor it to load the content better. Still, it's a first step. - Ben RE: Create (google)map from the database - sogreen - Jul 27th, 2011 This is incredible! I am blown away by Form Tools 2.1. I especially love the google maps module. I am hoping to implement it on a website that I am doing for a construction company but I am having a bit of trouble with the map. I currently have an internal form where the client manages each project and it is diplayed dynamically on the website (http://www.carverconstruction.ca/cc_projects.php). However, the client would like the added feature of a map that shows each location and when they click on each starred location it brings up the information below. Furthermore, they want to be able to edit this right from formtools. I have experimented with Map Channels but it just isn't what I am looking for. After seeing the new google map module, (http://hello.formtools.org/) it is exactly what they had in mind. I just don't know how to display it on the webpage. Is there anyone who can write a customized script for me? If so, how much would it cost? (May 14th, 2010, 6:24 PM)Ben Wrote: And here's a first draft of my own Google Maps script: RE: Create (google)map from the database - Joe - Jul 27th, 2011 Hey Sogreen, Thanks so much for the feedback. We've put a lot of thought into 2.1 and hope that it will make everyone's lives a bit easier. I'll PM you in regards to the customization work. Just to give you a heads up things are pretty crazy at the moment with the release of our Facebook form builder module. Our schedule is booked pretty solid at the moment but we'll do our best to help you out. Cheers, Joe |