I need to build a postcode checker where the user will put in a postcode and it they will be presented with a google map with their 3 nearest retailers. It will also need to zoom in to the point where it shows all the 3 results, unless there are only 1 or 2 results.
I have been given an excel document with the following information:
Company
Address line 1
Address Line2
Postcode
URL
Contact telephone number
If the user is then presented with a retailer on the map, they can then click on the icon, which will display a tooltip with the relevant information. Company name, url etc.
I’ve used the google maps API a couple of times but not done anything as advanced as this. I need to know how google maps will read the data in the excel document, will I need to convert it into an XML document, or would it need to be added into the database?
Is the postcode enough for google maps to go off of? Or would I need to add the longitude and latitude?
I guess I would need google maps to workout which postcodes are closest to the ones that user has inputted to the search box, then to present the closest three.
It’s being built into a DRUPAL based site, and would be good if the results could be CMSable so the client can go in at any time and add new retailers.
Like I said it's not something i've built before, so really just looking for advice.
Thanks!
I have done this several times and im not claiming the following manner is the way to go.
I usually let the customer fill in the addresses in the CMS, and use an function to determine the long/lat based on the addresses to save the lat/long and the full adres.
After that i use jquery at the front to loop through the lat/longs to place markers on the map, by using an setBounds function which google map recognizes you can center the results. (Like you said zoom on the markers).
While looping through the markers you can append text to the markers.
The above is step 1.
Step 2:
You have to rebuild the map after you enter postcodes, for this i use ajax. I fire my info to an page which again converts my potscode to lat/long and based on the lat/long i can do an select on the database and return the events to my map. After that Step 1 goes in action with new data.
Note: You have to gather some information which you can find on stackoverflow on how to combine these actions.
Turns out Google have a tutorial on how to do something similar, documentation can be found here - https://developers.google.com/maps/articles/phpsqlsearch_v3
Related
I am doing a website project related with travel. I think a long time, searching on the web for a long time. However I still have no idea how to get started. I really need help.
A brief description of my travel project first.
I need to use my own map. It can be zoomed in or zoomed out like Google Map. On the map there are many scenery spots, like spot A, spot B, spot C, etc....
When visitors open the map, click on the spots, for example, spot Y, spot A, spot M, etc.... I need to get which spots they clicked on, group all data, and finally write the data into MySQL database.
Here's what I find up to now:
I find many jQuery plugins and tools, like OpenLayers, mapTiler, mapBox, etc.. They all use Google Map, Open Street Map, and other maps, but not allow to use own map.
I also find Gmap Image Cutter which can cut my large map into tiles and display on the web. However the map cannot be clicked on get the data as required.
My questions:
I can master PHP and jQuery.
Could someone give me some idea how to get started?
Which tool or plugins can best accomplish my projects?
Thanks
The Google Maps JavaScript API provides an OverlayView class for creating your own custom overlays.
Link to doc: https://developers.google.com/maps/documentation/javascript/customoverlays#subclass
Link to example: https://developers.google.com/maps/documentation/javascript/examples/overlay-hideshow
And last, but not least, Google Maps can be embedded into your website: https://developers.google.com/maps/documentation/embed/
I have a problem.
My current php project provides a Google Map at the users.
This map is managed by a javascript Script.
Now the problem: i need to insert in this map like an Infobox that contains informations about the map.
This box must be fixed in the corner, and not attacched in some point of the map.
But n the v3 APIs i dont see anything to make this.
Is possible with these APIs?
Thank you all.
Use the Controls piece of the API to create your info box and add it to the map. See the custom controls sample for an example. You can put whatever content you want in a div, and then place it on the map in one of the ControlPosition types.
I'm working on a Google Maps project for the 1st time and I've done a lot of reading and now I need to put it all together.
I have PHP website and a mysql table of locations and I need to show a marker and some info for each location. I have already geocoded the locations so I have latitude & longtitude for each one. I've seen a number of things in the documentation pages but first I'd like to know if I can combine it all in one.
I would like to use the following options:
MarkerCluster for a better display of areas with many near-by markers
ClientLocation for loading the map at the location of the user to show what's nearby
Complex Icons Use custom icons per category
Custom InfoWindows
Also, I'd like to know what is best, to save all locations to an XML or pass them to the API dynamically each time the map is loaded?
In case you haven't read them already, I think the following articles can help you:
Using PHP/MySQL with Google Maps
Creating a Store Locator with PHP & MySQL
From Info Windows to a Database: Saving User-Added Form Data
Would it be possible (either in Javascript/AJAX or PHP) to get some twitter data (preferably some hardcoded hashtags), but based on countries? Does Twitter give you this kind of information?
Basically, I want something like: "How many users used the tag #sex grouped by country and show only top 10 countries"
One solution would be to get all tweets with #<country> and then see how many also contain #sex, but that would mean to get a huge amount of tweets.
I have used the Twitter search API documented here:
https://dev.twitter.com/docs/api/1/get/search
To do something similar to what you are asking, I use the geocode attribute, which allows you to return tweets within a certain radius of a long/lat point. My example below returns tweets within 350miles of the centre of England.
http://search.twitter.com/search.json?q=search&callback=?&rpp=25&geocode=54.16243396806781,-3.6474609375,350mi
Hope this points you in the right direction.
I'm working now on google maps, I'm trying to build something not even half as extensive but something on the lines of http://wikimapia.org/. Ok I'm not going to be building the whole app haven't got that much time on my hands. However the application I'm working on has users signing up and they would be able to pin point and create locations on a google map which would be stored in my back-end database.
Plus there would be a search option whereby a user could search for a specific place and all list of matching entries would be displayed as an 'overlay' to the map and all places would be highlighted on the map.
Also if you've noticed how wikimapia works - you can add a place by virtually clicking and dragging on the map itself as opposed to adding in coordinates on some complicated form and the search is embedded within the map and not outside.
Now I have an idea of integrating basic google maps - no biggie there but this is not just a simple integration procedure. Does anyone have any idea what I need to do here.
I'm working on Php and using JQuery for javascripting.
Thanks for the response - however my query was different in this respect that my application is such that we would have users signing up and they would come and pint point and create new locations on the map so basically its not one user - all the coordinates would be entered by the users in a 'click your place on the map' kind of way and we would like to be able to overlay all those details upon the map as well as categorise like lets say - show all places on the map where theres a birthday party, or show all internet cafes on the map - i.e. all these details are entered by users.
Maybe I'm missing something here - but I'm looking to make a simplified watered down version of wikimapia here.
If you want to integrate with Google Maps, I think the best place to get started is the source: http://code.google.com/apis/maps/, specifically the documentation and API reference. Get yourself a key, drop one of the examples into your page and start tweaking.
For your points, you'll basically store coordinate information (lat/long), plus whatever information you want to display. You can even have custom map tiles (the pictures of the world), or custom map overlay tiles (transparent additions to the displayed world). It really is a quite flexible API for mapping things.
When you run into a specific issue, ask.