Google Map static vs Dynamic business and buildings view - google-maps

I have a problem when i try to display a static map that display all elements
for example:
http://maps.googleapis.com/maps/api/staticmap?&zoom=18&size=640x640&markers=color:red|40.7191413,%20-73.9973273
In it i can't view any business and buildings.
If i display same map with same zoom in google maps or in any other application that dsplay dynamic map
i can view them.
For example:
https://www.google.it/maps/place/40%C2%B043%2709.1%22N+73%C2%B059%2751.0%22W/#40.7191413,-73.9973273,18z/data=!4m2!3m1!1s0x0:0x0
I have read this faq:
https://developers.google.com/maps/documentation/business/faq#no_pois
and tryng to apply it in this mode:
http://maps.googleapis.com/maps/api/staticmap?&zoom=18&size=640x640&markers=color:red|40.7191413,%20-73.9973273&style=feature:poi.business|element:all|visibility:on
but don't work
I's a limit of Static Map o what?

The Static Map API typically shows fewer points of interest compared to Google Maps or the Maps JavaScript API. This is working as intended, so unfortunately you can't do anything to get more POIs to show up.
You can consider using the Google Maps Embed API which might better meet your needs.

Related

Different default viewports in Google Static Streetview API vs Google Maps Embed API

I'm looking for a way to get the default heading in the Google Maps Streetview Embed with the same accuracy/heading as the static Streetview.
For a project I'm using the Google Maps static Streetview API to create a snapshot/front facing view of an address. The way I do this is to first find the address LatLng with the Google GeoCode API, using the full address (streetname+house_number+house_number_addition+zipcode+city). With the latLng I then call the Static streetview API to fetch a snapshot of this location.
https://maps.googleapis.com/maps/api/streetview?size=900x600&location={$latLng}&key={$key}"
As you can see there is no heading param specified so the API determines the best possible heading based on the given LatLng, as specified in the API docs.
The result is spot on for 99% of the cases, in which the house is almost perfectly centered in the streetview snapshot.
The Google maps streetview embed has a very different result. The steps leading up to the creation of the embed URL are identical (find the latlng based on the full address, and use the LatLng as the location in the embedcode)
https://www.google.com/maps/embed/v1/streetview?key={$key}&location={$latLng}"
resulting in the iframe HTML
<iframe src='{https://www.google.com/maps/embed/v1/streetview?key={$key}&location={$latLng}"}' width='600' height='450' frameborder='0' style='border:0;' allowfullscreen='' aria-hidden='false' tabindex='0'></iframe>
In this case the heading or camera direction is in many (not all) cases almost facing opposite of the targeted house. Of course this can be adjusted using the heading param, but it's strange that both streetview API's differ so much in the chosen heading.
After some more digging I found the answer here. The solution is to first use the Directions API to navigate to the given location, which sets the heading facing the location. Then use the getPanoramaByLocation method of the StreetviewService to determine the correct heading.
So instead of constructing the embed code serverside, the best approach seems to create the Streetview in the frontend using the Google Maps API.

Query existing, public Google Map via the Google Maps API v3

I am trying to embed an existing, public Google Map into a website. Specifically this one:
http://goo.gl/maps/cHf2
Of course I could use the iframe embed to achieve this, but I would like a little more control over the map … I imagined being able to pull all the markers from the map and display them as an index next to the map. Kind of like Google already does, but embedded in my page with my own styles and images.
I have been digging through Google, Stack Overflow and the API instructions and couldn’t find any relevant posts. In the GET string of the map on Google we can see this chunk:
&msid=212828439842926497866.0004bfae4da003d8ffd1f&mid=1341413217
I thought in there might be a maps ID and I could use it to query the content of the map through the API? The intention is using Google Maps as a CMS for less technical minded people and not dealing with geo data in our own CMS.
Any help would be greatly appreciated. Maybe I am just missing the forest for the trees.
You can download the kml that specifies the markers in that page and display that on your API based map. This example defaults to displaying it using geoxml3, but you can hide that and display the KmlLayer version.
You should be able to just point KmlLayer to the link (I downloaded the kml and put it on my server so it would work with geoxml3).
Here is an example (taken directly from the documentation) that does that
here is the original

How to retrieve a static map showing city or municipality boundaries

I'm not sure where to start looking in the documentation, but I'm trying to load map images of cities with their boundaries outlined.
Like this...
Any help getting started would be greatly appreciated, I'm pretty new to the maps api.
Thanks
There is currently no way to request a map with boundaries automatically rendered on it. Your best bet is to pull the polygon information from another system and render using an encoded polyline if you're using the Static Map API or regular overlays in the JavaScript API.
Google Static Map API
Here it is
here, some links to help you:
Geographical boundaries of states/provinces -> Google Maps Polygon
EInsert extension
Boundary Draw - Google Map Application
Getting neighbourhood boundaries from Google Maps API
https://stackoverflow.com/questions/8441467/can-you-draw-custom-search-boundaries-in-google-map
Ability to draw boundaries on Google Maps

Place markers through search in Google maps API (static)

I am currently working with the Google Maps API and returning static maps (images) from the API.
I need to place markers on the map. The documentation says how to place markers on the map by defining long/lat values: http://code.google.com/apis/maps/documentation/staticmaps/#Markers
My problem is that i don´t know where to place the markers. I want a google maps search phrase to determine the placement of the markers. Is that possible?
To sum up:
I want to submit a search phrase to the API and have a static map (image) returned with markers matching my search phrase.
You can place markers based on an address:
http://maps.google.com/maps/api/staticmap?center=55.665149742004,12.5627200816055&zoom=12&size=640x640&sensor=false&maptype=hybrid&markers=color:blue|label:S|smallegade%201,%20frederiksberg
Yes, it's possible. Try this:
http://code.google.com/intl/pl/apis/maps/documentation/geocoding/
This particular link regards to Maps API Web Services, but there are others api, for javascript for instance.
Generaly you need Geocoging that tranlate address to latitude and longitude
I believe you can not search a term in Maps Static version. It is not in the accepted parameters: https://developers.google.com/maps/documentation/maps-static/dev-guide#Usage
Try using Embed or JavaScript versions instead.

google maps: use directly on google server?

Usually u have to set up a little script + htmlpage on your server to run google maps,
but i was wondering - is it possible to use google maps directly?
i mean by just calling an url with parameters (gpoint coordinates, zoomfactor ..) and it loads the map fullscreen without having to use my own server?
Sounds like you might be after the static maps api. You can build a URL specifying the properties of the map like:
zoom
position
markers (including custom markers)
image size
etc
and you will get back a rendered image of the map. Something like:
Obviously this just gives you a fixed image of the map you are after. If you need a dynamic Google map, then you will need to use the Google Maps Javascript API.
Not hosted by Google. You might find some other website that uses the API to do the same thing.
Google Maps API