September 13, 201115 yr I have been asked to create a custom google map with a search function and I have no clue where to start. I know how to embed a google map thats the easy bit, its adding some functionality to it. I need to add markers the map and then have a search box that when the user enters their own postal code it will take them to the closest map marker. any ideas?
September 13, 201115 yr Hi Funsella Can you elaborate? Does the second marker (user in-putted) need to relate to the first? Directions? You need to read up on the Google Maps API. I warn you now, if you're not used to this, it can take a long time and a lot of brain racking to get the maps to do what you want. Your first bit is easy. The second bit involves Geocoding. You can do that on one I made here: http://jsfiddle.net/brightonmike/FPtGF/ You enter two addresses and the map then Geocodes the addresses, and plots the marker on the map. You can see the kind of code you'll need to write in the javascript box. The functionality on this map is actually less than what you're asking (except for the line, unless you want lines?) so you can get an idea of what you'll be doing. Here's where you need to start: http://code.google.com/apis/maps/documentation/javascript/basics.html Here's an example of something similar to what you want, but minus the marker: http://code.google.com/apis/maps/documentation/javascript/examples/geocoding-simple.html Edited September 13, 201115 yr by brightonmike
September 13, 201115 yr Author Hi Funsella Can you elaborate? Does the second marker (user in-putted) need to relate to the first? Directions? You need to read up on the Google Maps API. I warn you now, if you're not used to this, it can take a long time and a lot of brain racking to get the maps to do what you want. Your first bit is easy. The second bit involves Geocoding. You can do that on one I made here: http://jsfiddle.net/brightonmike/FPtGF/ You enter two addresses and the map then Geocodes the addresses, and plots the marker on the map. You can see the kind of code you'll need to write in the javascript box. The functionality on this map is actually less than what you're asking (except for the line, unless you want lines?) so you can get an idea of what you'll be doing. Here's where you need to start: http://code.google.com/apis/maps/documentation/javascript/basics.html Here's an example of something similar to what you want, but minus the marker: http://code.google.com/apis/maps/documentation/javascript/examples/geocoding-simple.html Thanks for this, Its a lot to take in, didnt realise that it was so complex ... was hoping that some one would say here is the link this will make all your google maps dreams come true. Will be spending a couple of days on this. Thanks again for your comment
September 13, 201115 yr No worries Funsella. I can try and help you through it, so keep us updated, but essentially when you want to do something specific there is no "cut and paste" way of doing it. It took me 3 weeks to do what I wanted to do
September 13, 201115 yr Nightmare, isn't it? One of my recent projects relied heavily on geolocation, and it was an absolute arse to set up, even with the V3 API. Edited September 13, 201115 yr by Renaissance-Design
September 13, 201115 yr Author No worries Funsella. I can try and help you through it, so keep us updated, but essentially when you want to do something specific there is no "cut and paste" way of doing it. It took me 3 weeks to do what I wanted to do Luckily for me they told me to put it on hold as I am busy with my first wordpress build. A bit stressed as I only have 3 days for the build and tomorrow is day three. Thats why I was hoping there would be a quick fix for doing this. Will keep you posted on how I get on when I get started with the Google map
Create an account or sign in to comment