I have an array of latitudes/longitudes and Descriptions that I want to display on a Google Map.
Does anyone know of an API (or even better a tutorial) that describes a good way to accomplish this or something similar using PHP and/or Javascript?
http://code.google.com/apis/maps/index.html
The static maps API is the simplest to use. You can use PHP and cURL to grab the map you need with the data you have (latitude/longitude).
Google labss: Google fusion tables: then make those two lat/lon fields the "location"
google for the term: google fusion table map
Related
First of all I would like to tell you that I am not sure if I use the terms correctly so please excuse me for any misunderstandings. I will try to clear everything.
What I want to do is to let the users on my website to select their favorite bar or restaurant and add it to their profile.
It should be more or less like maps.google.com but in a smaller dimensions let's say 400x400. The users will be able to search for a place and once they find it they will be able to save it to their profile.
I am confused though because Google offers the Google Maps and the Google Places. I do not see any tutorials around regarding Google Places..
The question is.. Can I do my small project by using google maps or I really need to use google places?
Is there any tutorial/link which shows how to store on my database the current map location?
Thanks in advance!
Ok after some more searching I found my answer which was pretty simple.
It looks like I can get the lat and lng from place.geometry.location .
The rest about storing it to the database is easy!
Thanks anyone who at least read my post!
Cheers!
I'm essentially trying to build a kind of store locator using Google Maps geocoder, but I want to find a way to write code that returns the nearest stores as hyperlinks on the page (probably inside a div), without placing everything on a map. I don't want to use a map, or markers and infowindows, etc... at least not to begin with.
I've followed a lot of the Google Maps API tutorials online, and it's been easy enough to build a basic working store locator that returns a set number of results inside a given radius by checking the input latlng against the values in my database, but I'm not all that skilled at js, and was wondering if anyone knew of any tutorials that might demonstrate the use of the geocoder for returning latlng search results just in text format, without a map.
Thanks.
The use of the Google geocoder is not allowed without using the results on a Google Map.
Note: the Geocoding API may only be used in conjunction with a Google
map; geocoding results without displaying them on a map is prohibited.
For complete details on allowed usage, consult the Maps API Terms of
Service License Restrictions.
How can I code something which'll calculate the driving distance between 2 zip codes within the USA in PHP. An API or web service that has SOAP or REST will also do.
But I understand GoogleMaps API can't be used because it violates the TOS.. So I need a way without using Google Maps, because I have no intention of using their maps, just calculate the distance.
There isn't a whole lot out there that's free, other than Google Maps. The MapQuest API may give you what you need. Here's their guide to the service - it addresses getting driving distances/times between a set of points. Their terms of service don't appear to require that you display a map, but take a look and see if that meets your needs.
Google Maps Distance API has this exact Functionality. You can get a return as either xml or json.
Here is the documentation
https://developers.google.com/maps/documentation/distancematrix/
Here is a sample of the request url :
http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&mode=bicycling&language=fr-FR&sensor=false
One nice thing is you dont have to calculate the long/lat first
I need to color code counties on my google maps based on the markers on these locations. Anyone with some idea as to how this can be done? I am using google earth
I can create markers dynamically and show my data. Now I need to find a way to style google maps.
As of right now Google does not support county shading it seems. With map charts here, it lets you shade countries and states.
http://code.google.com/apis/chart/image/docs/gallery/new_map_charts.html
The closest I've got to seeing county shading is an example here:
http://maps.google.com/maps?f=q&hl=en&q=http://lazylightning.org/mncounties-sorted.kmz&ie=UTF8&z=6&om=1
You can read a little bit about how it was made here:
http://www.lazylightning.org/minnesota-county-kmz-overlay-for-google-maps
Other links that you might find useful:
http://nationalatlas.gov/atlasftp.html?openChapters=chpbound#chpbound
http://freegeographytools.com/2007/converting-e00-vector-data-to-shapefiles-a-free-and-fairly-painless-approach
http://www.zonums.com/shp2kml.html
I'm not sure how extensively you can customize Google Earth, but if you're not dead-set on it, try one of these: Google Visualizations
Depending on which one you choose (I believe there are three different types of maps available,) there are loads of customization possibilities. Also, none of these require a proprietary plugin like Google Earth does (just Javascript and Flash. Okay, Flash is a proprietary plugin, but I'm sure it's far more common than the Google Earth plugin.)
Is it possible to find geolocation using zip code using PHP.
For example, if i am entering the zip code i need to find the name of that particular zipcode.
Is that possible? if yes kindly explain me how?
Thanks in advance
See the duplicate question on how to turn an address into coordinates using the Google Geocoding service.
A query in the format [zipcode], United States, e.g..
72116, United States
should always work for you.
Try maps.google.com to simulate the request.
The XML returned from the Google Service will contain the official place name, as well as other information like county and state names etc.
You can do this through Javascript and PHP using Google's Map API - check this question for an example of how this is used.
I dont think it can be done solely through PHP however because you'd need to access an API's data and they normally (not always) do this through javascript.
You should check the API documentation.
You can access the Geocoding API solely using PHP.. you don't even need an API Key anymore.
http://code.google.com/apis/maps/articles/phpsqlgeocode.html
So if understand this correctly, you want to know the City/State of the zip code you have entered?
Maybe you should look into the Access database here :
http://databases.about.com/od/access/a/zipcodedatabase.htm
And if you find it useful, just convert it into a MySQL table and use as you please.