ZIndex on Clusters - google-maps

I am attempting to add custom labels to a map such that the labels are visible on top of the clusters I created using MarkerClusterer. I set the zindex of the labels to 1000. How do I set a zindex on a cluster. I know how to do it with a marker but am not sure how to apply a zindex value to each of my cluster icons. I'd appreciate any help with this.
Thanks,
G

Thanks for the hint. Got it to work myself:
var pane=this.getPanes().overlayMouseTarget;

You could try to add your custom labels to a map pane that sits above the clusters.
See http://code.google.com/apis/maps/documentation/javascript/reference.html#MapPanes

Related

How can I change GMSMapView padding without moving the map

I'd like to be able change the padding of a GMSMapView without changing the location of a map. Right now, Google Maps iOS SDK changes the map location so that the same point is in center after the padding has been applied. This is different than how the Android SDK works, which just leaves the map as it is.
I've found a slight workaround for this, but it doesn't work consistently. I can calculate what the new center location should be and update the map camera when I change the padding with the following...
UIEdgeInsets oldPadding = self.mapCtrl.map.padding;
UIEdgeInsets newPadding = UIEdgeInsetsMake(top, left, bottom, right);
float deltaX = ((newPadding.right - newPadding.left)/2 - (oldPadding.right-oldPadding.left)/2);
float deltaY = ((newPadding.top - newPadding.bottom)/2 - (oldPadding.top-oldPadding.bottom)/2);
GMSCameraUpdate *updatedCamera = [GMSCameraUpdate scrollByX:deltaX Y:deltaY];
[self.mapCtrl.map setPadding:newPadding];
[self.mapCtrl.map moveCamera:updatedCamera];
But I'd say it only works 50%. The other 50% the map moves to the new padding location and then back to where I want it to be.
I see two possible solutions for this... A) change the padding in a different way so that it doesn't move the map, or B) figure out a way to get the above code to work by somehow pausing or grouping map movements so that both calls only go through at once. But I can't figure out how to make either of those two things happen.
Make sure you have the same padding on top and bottom so everything keeps centered.
In case someone needs it in the future:
mapView.padding = newPadding
mapView.layer.removeAllAnimations()
That messes with the internals of GMSMapView though and the padding isn't applied to the map itself correctly, just to the UI.
I use the following code to re-apply the padding again after my animation so that the map behaves correctly again.
let newCenter = mapView.projection.coordinate(for: mapView.bounds.inset(by: newMapViewPadding).center)
mapView.padding = newMapViewPadding + UIEdgeInsets(all: 1)
mapView.padding = newMapViewPadding
mapView.moveCamera(GMSCameraUpdate.setTarget(newCenter))
It's correct that we need to set a padding with top AND bottom to keep things appearing correctly, but it's also important to do it AFTER attaching the view to it's parent.
I was doing it before and it did not work properly.

Position mapicon below mapcontrol center

please I need help with positioning of the mapicon below the mapcontrol.center point like this screenshot here http://www.windowsphone.com/en-us/store/app/sygic-gps-navigation-maps-poi-route-directions/340f7b71-86bc-4f99-8c59-d4a6126c10b1
Use NormalizedAnchorPoint property of the MapIcon class. It takes a Point, with x and y ranging from 0 to 1.
Based on your screenshot (3rd one), you should use a value of (0.5, 1).
MapIcon icon = new MapIcon();
icon.NormalizedAnchorPoint = new Point(0.5, 1);
I choose a different option by using 'RenderTransform' which enable me to extend the 'MapControl' below the bottom of the page and thereby moving the 'MapIcon' and MapControl center closer to the bottom of the page just as i wanted. Its not clean but it worked.

Auto zooming the map control

When we display a Map control on Windows Phone 8, and we display a MapRoute, is there any way to auto set the zoom level so the full route first?
To auto-zoom the map in c# with a list of coordinates (instead of a route), you can auto-generate a view by using the following:
//Adjust zoom
LocationRectangle lr =
LocationRectangle.CreateBoundingRectangle(myGeoCoordinate, incidentGeoCoordinate, [and more]);
myMap.SetView(lr);
If you have "Route" instead of "MapRoute", you can use "BoundingBox".
yourMapControl.SetView(route.BoundingBox)
There's no way to say "zoom to include points A,B & X,Y" but if you know these you could calculate the distance between them and the center point between those outlying points and then center on that point and then set a zoom level which will include the whole area.

Java3D Zoon- Object starts disppearing az I zoom on it

First of all, I would like to say that I'm a newbie in Java3D. Please bear with my ignorance.
I have made an application with Java3D and I have the following problems with zooming.
It seems the MouseWheelZoom behaviour of Java3D moves the object along Z-axis. On the scene my Z-axis is not out of plane so by using MouseWheelZoom , the object doesn't get closer but it get out of screen. Is there a way to set the zoom direction to an arbitrary direction?
I have got around the problem by using MouseWheelListener and changing the viewing platform based on zoom steps. But there is another problem now. As the object gets closer than a certain distance, some parts of the object ( usually the corners) start disappearing so I can't zoom as much as I desire.
Could you please help ?
Regards,
Hassan
Question:
I guess you use an OrbitBehavior for MouseControl like:
orbit = new OrbitBehavior(canvas3d, OrbitBehavior.REVERSE_ALL);
If that is the case then try
orbit.setZoomFactor(-1d);
To reverse the zoom direction (the default zoom factor is +1d).
To your 2. Question:
You have to set a BoundingLeaf on your PlatformGeometry to encapsulate your "viewing area".
Try something like this
defaultBounds = new BoundingSphere(new Point3d(radiusGameMap, 0.0, radiusGameMap),
radiusGameMap * 6.0d);
BoundingLeaf boundingLeaf = new BoundingLeaf(defaultBounds);
PlatformGeometry platformGeom = new PlatformGeometry();
platformGeom.addChild(boundingLeaf);
where radiusGameMap is a double defining the radius of your whole map.

Make absolutely-positioned <div> fall below info windows on Google Maps

This image should explain my problem:
alt text http://dl.dropbox.com/u/2792776/screenshots/2010-06-30_1304.png
I'm using version 3 of the Google Maps API (if relevant)
You can get the z-index of the infoWindow by using the getZIndex() mthod and set the zIndex for your overlay at anything lower than that or you can explicitly set the zIndex of an info window using setZIndex() method and set the zIndex to something really high..
so ..
z = yourInfoWindow.getZIndex();
yourDivID.style.zIndex = z-1;
or ..
yourInfoWindow.setZIndex(666);
If you post the code or a link to your app I could help you further..