how to integrate google map? - google-maps

i had implemented google map API with phoogle.php. Its working fine. But i cant able to view multiple places.
Example: all country,all beaches

Not completely clear from your question what it is that you are trying to do here.
I had a look at the Phoogle documentation and it seems like the framework it provides is pretty limiting.
It exposes some methods for setting a key, displaying a map, configuring a few basic UI characteristics and setting the zoom level. It seems like you can also add addresses to be geocoded to lat,lng and then added to the map as markers.
It won't geocode anything as generic as "all countries" or "all beaches".
I can only suggest (and I am guess wildly here) that you might want to populate a list of countries and then geocode (addAddress) just the country names to place markers on the map for each of those countries.
I can't imagine you wanted to place a marker on "all beaches", but you might want a list of beaches ("palm beach, sydney, australia" for example) and similary geocode those names and mark then on the map.
If you would like to read more about what the Google Maps API is capable of, I suggest you have a look at the API Reference.
If there is something more specific that you wanted to do, please update the question and we would be happy to help.

Related

How google get polygon data for locality in a city

I have seen google showing polygon lines for locality in a map. eg: https://www.google.co.in/maps/place/Koramangala,+Bengaluru,+Karnataka/#12.9354922,77.6146828,14z/data=!3m1!4b1!4m5!3m4!1s0x3bae144ed898fc2d:0x1681f38e8c00ae56!8m2!3d12.9279232!4d77.6271078
I wanted to know how google gets this data. Do they use any kind of mapping of images to the government data available in the countries in the world. I dont think all the countries provide data (lats, longs) at such granular level.
Right now this feature is unavailable for Google Maps API. But there is a feature request on Google's Issue Tracker that you can star and comment on.
Here's the link:
https://issuetracker.google.com/35816953
There are workarounds for this though where you get the data elsewhere and draw the polygons yourself.
Here's the link to that:
Google Maps how to Show city or an Area outline

Add Markers to Google Maps based upon type of business

Using the Google Maps Api v3 I am wandering what the simplest method is to add Markers to my map based upon a certain type of business.
E.g. Display markers of coffee shops, or dentists etc etc...
I understand this will probably be achieved by manipulating the MapOptions I am just yet to figure it out.
Thanks in advance,
Dan
I answer quickly but I guess that because you posted your question here you are building a web application and you have a MAP and you want to retrieve particular type of business and display the result on your map.
You can get the result based on certain types of business.
This is the official guide to get places:
To see which are the type of "places" the API support click here.

Get type of terrain by coordinate

I'm looking for a solution to be able determine landscape type by a given coordinate, for example check if current position is water/forest/town/road and so on. I found google.maps.MapTypeStyleElementType object specification in the Google Maps specification, but not sure if it could help me or not.
Probably, there are some another Maps API with such functioality? Or maybe I should refer to the different types of offline maps?
Nope, the link you send is just for styling the proper features, not to tell which feature is at a given coordinate. If you are interested in landscape, then Corine Land Cover is the thing you are looking for. It describes the types of biotops like forest, water, but also land use - meadow, field, buildings etc. However, I don't know if there is such an online service where you could query particular coordinates. Other solution for you would be to import these GIS layers (they are freely available) to your own gis map server. Maybe this is partially solved as there are e.g. projects how to incorporate these into openstreetmap.
Well not quite, but you could get close to what you're looking for by using the Google Reverse Geocoder and the Google Places API
Google Reverse Geocoding
http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding
If you send the service a geocode it will send back an address type and/or one of several adress components http://code.google.com/apis/maps/documentation/geocoding/#Types
Google Places API
http://code.google.com/apis/maps/documentation/places/
You could use the Google places API to search for for what's near. If the geocode is in the middle of the lake, the Places API may return something like "Lake Michigan" and then you'd know the terrain obviously.

Do I need to geocode countries/popular locations to add as markers to Google Maps?

I have a script that generates a ton of locations/places based on a users input. I want to add these places as markers on Google Maps based on javascript APIv3, but I would easily go over the geocoding limit.
Is there a way simply to insert a string of a popular location into the markers options variable and have it load on the map? So insert "Boston, USA" instead of latlng(X,Y)? Are their other options available to me? I know of free geocoding APIs, but not all my locations are in the US.
The only way to specify a Marker's location in Google Maps JavaScript API v3 is with a LatLng object. You cannot specify the Marker's location with a common name like "Boston, USA".
One thing you may want to consider is how a map will perform with lots of Markers. (I'm assuming by "a ton" you mean at least 500.) That might heavily tax your user's computer/device and the user may end up with little more than a blob of markers that's less than completely useful. Perhaps you can test with, say, 1000 markers on a less-than-kickass machine and see how your code performs. You may find that you need to rethink your interface in a way that reduces the number of markers you use anyway.

Google maps API - how to include marker (and info) for specific business address?

All the methods and examples I can find about the Google maps api is based on a postcode, or coordinates to get the desired location - what if I want to place a marker for a specific business which has been added to google maps, so it shows tel number etc like an embeded map would? Even if I use exact coordinates for the address it doesn't recognise it. Sure I'm missing something really simple here...
Thanks!
The Google Places API, this does what your looking for. I couldn't tell you how to implement as of now because i am trying to put it inside of my Rails application but i will update my answer in the future when i do get it working though.