Google maps set heading not working and map remains on heading to north - google-maps

I am trying to do: map.setHeading(180) but this doesn't work and map remains heading to north. Everything else is working - I am using the very basic template of Gmaps from their docs, zoomings, pannings, markers and other things work as excepted, but the heading not. What am I missing in here?
For example, I got the position and heading from the GPS and I move the marker using marker.setPosition(position) which also works as excepted.

Tilt and rotation are now supported programmatically and by user input when using WebGL rendering. Please see https://developers.google.com/maps/documentation/javascript/webgl/tilt-rotation for documentation and examples.

Try beta version of JavaScript API. add v=beta in url.

The reason for this is that you can use setHeading if your map is displaying 45 degrees imagery as stated on the documentation.
It looks like your use case is the same as this existing Feature Request which is requesting for a feature to change the orientation of the map. You can star the issue to receive updates regarding the issue. You can also leave a comment on the issue regarding your use case.

Related

Setting perfect zoom level for a Place with Google API

In my Google Maps app the user can search for a place (using Autocomplete) and the map will be re-centered upon it with map.setCenter(pos);.
This does not change zoom level though, that must be done manually with map.setZoom(x).
In Google's map, zoom automatically readjusts to perfectly show the place's boundaries, how can I replicate that behavior?
The duplicate #woelliJ found almost worked, but ended up using an old version of the API. It led me on the right track though, and I ended up finding how to make it work with the new API - map.fitBounds(autocomplete.getPlace().geometry.viewport);

Ushahidi - How to make the markers stay on the map on zoom change?

I am using the platform Ushahidi Web-2.7.3 , see: http://ti5.net.br/provedorlegal.com.br, and when I zoom in beyond a certain level, the clustered markers disappear from the map. I also tested this on an older version of a site, see: http://movimentofichalimpa.org/mapa, where the clustered markers do not disappear on zooming in, but just become ungrouped, as is normal with a cluster strategy. How can I make the markers remain on the map when zooming in?
Ushahidi actually uses OpenLayers under the hood -- the images may come from Google, but the Javascript library is pure OpenLayers. These markers are actually generated by adding what is known as a context to the style attribute of the OpenLayers.Layer.Vector and an associated Cluster.Strategy. There is a good example of it working properly here: OpenLayers cluster example and if you look at the Javascript source you will see how it is done: view-source:http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/strategy-cluster-threshold.html by defining a radius in the context of the styleMap.
The reason that your example isn't working is that there is actually a script error being triggered, which is stopping the clustering/styling from being performed. The styles are defined in the file ushahidi.js. If you open a Javascript debugger you will see the error for yourself that is firing before the ushahidi.js functions are called to determine the number of features in the cluster and therefore the radius of the markers.
The actual error is http://ti5.net.br/provedorlegal.com.br/index.php/json/cluster?s=1401591600&e=1404183599&z=9, but I have no idea why, as the OpenLayers is the minified version which is very hard to debug. You might find moving your application to OpenLayers directly will help, as it will be easier to debug, and it also works on mobiles, which I know is one of the reasons people like to use Ushahidi.

How do I remove 'Earth' button from Google Maps?

I'm using the Google Maps generator to create a few maps for a client. The maps embeded on the site are a bit small (255x176), so map real state is crucial. I've already removed the balloon, but can't find a way to remove the "Earth" view button from it (all newly generated maps come with it now, 4 views in total).
The annoying part is that the "Earth" view requires a Google Earth plugin to be used anyway, something the client could live without - me too.
Any advices there? Feedback will be greatly appreciated!
Cheers,
Wallace
You may customize the map controls using the MAPS API.
Visit http://code.google.com/apis/maps/documentation/javascript/controls.html#DefaultUI
Look for MapTypeControlOptions and pass appropriate map type you want to show.
Refer http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeControlOptions
http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeId
If using the default UI, you would get only the map types in G_DEFAULT_MAP_TYPES, which does not include the Earth map type (G_SATELLITE_3D_MAP).
This means your generator is adding this map type explicitly. So you should be able to simply look for G_SATELLITE_3D_MAP in the javascript you get from the generator, and remove references to it.
If you are still having troubles, can you provide a link to the map generator you are using?

google maps markers

How do do i add them to my google map ? I've added the marker manager
<script src="http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/release/src/markermanager.js"></script>
And used the same syntax as in the documentation but they don't show up. The coordinates are correct . Can someone please dumb it down for me . Also does the zoom level have to be to a specific value for me to see them ?
For anyone else in trouble
http://code.google.com/apis/maps/documentation/javascript/examples/index.html
Andrei,
I found the Google Android MapView tutorial to be very helpful:
http://developer.android.com/guide/tutorials/views/hello-mapview.html
It covers creating a basic map application, as well as adding overlays to the MapView, and links to the directions for obtaining the necessary API key. Unfortunately (like a lot of Google's example code, apparently), there are a couple errors in the directions, but I was able to fix those fairly easily.
For example, the definition of your Overlay Class should be:
public class HelloItemizedOverlay extends ItemizedOverlay<OverlayItem>
Which not precisely what the directions say. Eclipse turns out to be very helpful in fixing the problems with this, though.
As to your question about zoom level, it has been my experience that all of your overlays will be displayed as long is your zoom level (or pan state) allows it. If you push them off the screen, they're not displayed, obviously, but not lost either.
R.

Google Maps: Traffic on top of Custom Map

I want to add traffic information to my custom map. Currently I'm using a Tile Layer Overlay on my Google Map to display custom map tiles. When I try to add GTrafficOverlay to my map, my custom map tiles display above the traffic information. Is there any way to display the traffic above my GTileLayerOverlay?
(Using the JavaScript api)
You should be able to do this in V3. Take a look at this sample: http://code.google.com/apis/maps/documentation/v3/overlays.html#ImageMapTypes
I tried this out and wasn't able to find a solution to the problem. There is nothing in the GTrafficOverlayOptions and I couldn't find anything in the references about the z-order of this stuff. I have suspect that this isn't possible.
Would love to see an alternative answer showing that I am wrong.