Fixed
Status Update
Comments
d....@gtempaccount.com <d....@gtempaccount.com> #2
Can you track these events by assigning event listeners on the map container? For
example:
google.maps.event.addDomListener('map_canvas', 'mousemove', function(e) {
// code here
});
Granted, it'll take a bit more code on your end to determine whether the mouse is
within map container boundaries, but this seems like a feature you can add yourself.
example:
google.maps.event.addDomListener('map_canvas', 'mousemove', function(e) {
// code here
});
Granted, it'll take a bit more code on your end to determine whether the mouse is
within map container boundaries, but this seems like a feature you can add yourself.
d....@gtempaccount.com <d....@gtempaccount.com> #3
I have tried but my event handlers conflict with yours. The pixel arithmetic is
messy. It requires an additional OverlayView for the "fromPixelToLatLon" conversion.
You already have the same information for "click" & "dblclick" event handlers.
The browsers measure pixel offsets differently. Internet Explorer measures pixel
offsets relative to the parent DIV. Firefox measures pixel offsets relative to the
DIV containing the corresponding tile. An extra DIV is required in order to simplify
the Firefox arithmetic. Unfortunately, it covers your click layer which causes it to
fail.
messy. It requires an additional OverlayView for the "fromPixelToLatLon" conversion.
You already have the same information for "click" & "dblclick" event handlers.
The browsers measure pixel offsets differently. Internet Explorer measures pixel
offsets relative to the parent DIV. Firefox measures pixel offsets relative to the
DIV containing the corresponding tile. An extra DIV is required in order to simplify
the Firefox arithmetic. Unfortunately, it covers your click layer which causes it to
fail.
bb...@gmail.com <bb...@gmail.com> #4
OK, we'll consider it.
Thanks!
Thanks!
bb...@gmail.com <bb...@gmail.com> #5
The pixel arithmetic is not trivial. Browser differences must be accommodated.
Look at:
http://www.polyarc.us/polycluster/event.html
It is a lot of work just to track mouse coordinates. It is incompatable with your
event listeners.
Look at:
It is a lot of work just to track mouse coordinates. It is incompatable with your
event listeners.
d....@gtempaccount.com <d....@gtempaccount.com> #6
Please include the following Events in the v3 API that were present in v2
- loaded
- moveend
- loaded
- moveend
d....@gtempaccount.com <d....@gtempaccount.com> #7
@5
Have you tried using the 'idle' event? This should replicate the events you named.
Have you tried using the 'idle' event? This should replicate the events you named.
ta...@gmail.com <ta...@gmail.com> #8
Berry, I starred this request; I also implemented an event handler that seems not to
have some of the issues you listed in your post:
http://notebook.kulchenko.com/maps/gridmove . The pixel arithmetic is still not
trivial, but it seems like you and I would still need to do our own calculations as
it's unlikely that the API will report pixel coordinates we both need to support
canvas tiles.
Paul (http://notebook.kulchenko.com/maps/ )
have some of the issues you listed in your post:
trivial, but it seems like you and I would still need to do our own calculations as
it's unlikely that the API will report pixel coordinates we both need to support
canvas tiles.
Paul (
d....@gtempaccount.com <d....@gtempaccount.com> #9
Hi Paul,
Both you & I are doing way too much work for what was trivial with the old API. I
will be happy with a browser independent way to obtain "mousemove" Lat/Lon
coordinates without adding an OverlayView. Conversion back to pixels is easy. I am
trying to avoid extracting information directly from the DOM which might change.
Berry
Both you & I are doing way too much work for what was trivial with the old API. I
will be happy with a browser independent way to obtain "mousemove" Lat/Lon
coordinates without adding an OverlayView. Conversion back to pixels is easy. I am
trying to avoid extracting information directly from the DOM which might change.
Berry
d....@gtempaccount.com <d....@gtempaccount.com> #11
Ben / Pamela,
What is the status ? Anything on the horizon ?
Both Paul K & I have had to kludge something together. The pixel arithmetic is
nasty. Browser dependencies cannot be avoided. An OverlayView is required just to
obtain the the tile offsets. It is difficult to coexist with your other event handlers.
What is the status ? Anything on the horizon ?
Both Paul K & I have had to kludge something together. The pixel arithmetic is
nasty. Browser dependencies cannot be avoided. An OverlayView is required just to
obtain the the tile offsets. It is difficult to coexist with your other event handlers.
pa...@gmail.com <pa...@gmail.com> #12
We're rewriting our app for V3 for our new version launch. We make constant use of
the mousemove event, and it is pretty much the main reason we cannot bring the system
fully into the V3 API.
Does anyone have any idea of the timeframe for this (and other) events to be
implemented into the API?
Also, I can't help wondering: Why were they taken off in the first place?
the mousemove event, and it is pretty much the main reason we cannot bring the system
fully into the V3 API.
Does anyone have any idea of the timeframe for this (and other) events to be
implemented into the API?
Also, I can't help wondering: Why were they taken off in the first place?
pa...@gmail.com <pa...@gmail.com> #13
[Comment deleted]
d....@gtempaccount.com <d....@gtempaccount.com> #14
No need to get the offset from the browser and do pixel conversions, just draw a
transparent polygon over your map and use the mousemove listener on the polygon. Each
time the idle event occurs on the map, redraw your polygon. The only limitation is
that you can't zoom out beyond level 3 unless you add some functionality for drawing
polygons that span 180+ degrees (which wouldn't be too difficult).
=================================================
Code:
=================================================
var map = new google.maps.Map();
var mapPolygonOverlay = null;
google.maps.event.addListener(map, 'idle', function()
{
// Delete the previous mapPolygonOverlay if it exists
if (mapPolygonOverlay != null)
{
var mapPolygonOverlayVertices = mapPolygonOverlay.getPath();
// Remove all the points from the polygon
for (var i = mapPolygonOverlayVertices.length; i >= 0; i--)
{
mapPolygonOverlayVertices.removeAt(i);
}
}
// Draw a polygon that is the map bounds
var mapBounds = map.getBounds();
var NE = mapBounds.getNorthEast();
var SW = mapBounds.getSouthWest();
var NW = new google.maps.LatLng(SW.lat(), NE.lng());
var SE = new google.maps.LatLng(NE.lat(), SW.lng());
var mapPolygonOverlayPaths = [NE, NW, SW, SE];
mapPolygonOverlay = new google.maps.Polygon({
paths: mapPolygonOverlayPaths,
strokeColor: '#000000',
strokeOpacity: 0.0,
strokeWeight: 0,
fillColor: '#000000',
fillOpacity: 0.0
});
mapPolygonOverlay.setMap(map);
// Add mousemove listener to polygon
google.maps.event.addListener(mapPolygonOverlay, 'mousemove', function(event)
{
updateMouseLocation(event.latLng);
});
});
google.maps.event.addListener(map, 'zoom_changed', function()
{
if(map.getZoom() < 3)
map.setZoom(3);
});
transparent polygon over your map and use the mousemove listener on the polygon. Each
time the idle event occurs on the map, redraw your polygon. The only limitation is
that you can't zoom out beyond level 3 unless you add some functionality for drawing
polygons that span 180+ degrees (which wouldn't be too difficult).
=================================================
Code:
=================================================
var map = new google.maps.Map();
var mapPolygonOverlay = null;
google.maps.event.addListener(map, 'idle', function()
{
// Delete the previous mapPolygonOverlay if it exists
if (mapPolygonOverlay != null)
{
var mapPolygonOverlayVertices = mapPolygonOverlay.getPath();
// Remove all the points from the polygon
for (var i = mapPolygonOverlayVertices.length; i >= 0; i--)
{
mapPolygonOverlayVertices.removeAt(i);
}
}
// Draw a polygon that is the map bounds
var mapBounds = map.getBounds();
var NE = mapBounds.getNorthEast();
var SW = mapBounds.getSouthWest();
var NW = new google.maps.LatLng(SW.lat(), NE.lng());
var SE = new google.maps.LatLng(NE.lat(), SW.lng());
var mapPolygonOverlayPaths = [NE, NW, SW, SE];
mapPolygonOverlay = new google.maps.Polygon({
paths: mapPolygonOverlayPaths,
strokeColor: '#000000',
strokeOpacity: 0.0,
strokeWeight: 0,
fillColor: '#000000',
fillOpacity: 0.0
});
mapPolygonOverlay.setMap(map);
// Add mousemove listener to polygon
google.maps.event.addListener(mapPolygonOverlay, 'mousemove', function(event)
{
updateMouseLocation(event.latLng);
});
});
google.maps.event.addListener(map, 'zoom_changed', function()
{
if(map.getZoom() < 3)
map.setZoom(3);
});
ta...@gmail.com <ta...@gmail.com> #15
For anyone interested, here is the code to allow for zooming out all the way. Just
add it right before you create your new google.maps.Polygon().
=================================================
Code:
=================================================
if(map.getZoom() == 2)
{
var NC = new google.maps.LatLng(NW.lat(), map.getCenter().lng());
var SC = new google.maps.LatLng(SW.lat(), map.getCenter().lng());
mapPolygonOverlayPaths = [NW, NC, NE, SE, SC, SW];
}
else if(map.getZoom() == 1)
{
NW = new google.maps.LatLng(NW.lat(), -180.0);
NE = new google.maps.LatLng(NE.lat(), 180.0);
SW = new google.maps.LatLng(SW.lat(), -180.0);
SE = new google.maps.LatLng(SE.lat(), 180.0);
var NC = new google.maps.LatLng(NW.lat(), 0.0);
var SC = new google.maps.LatLng(SW.lat(), 0.0);
mapPolygonOverlayPaths = [NE, NC, NW, SW, SC, SE];
}
add it right before you create your new google.maps.Polygon().
=================================================
Code:
=================================================
if(map.getZoom() == 2)
{
var NC = new google.maps.LatLng(NW.lat(), map.getCenter().lng());
var SC = new google.maps.LatLng(SW.lat(), map.getCenter().lng());
mapPolygonOverlayPaths = [NW, NC, NE, SE, SC, SW];
}
else if(map.getZoom() == 1)
{
NW = new google.maps.LatLng(NW.lat(), -180.0);
NE = new google.maps.LatLng(NE.lat(), 180.0);
SW = new google.maps.LatLng(SW.lat(), -180.0);
SE = new google.maps.LatLng(SE.lat(), 180.0);
var NC = new google.maps.LatLng(NW.lat(), 0.0);
var SC = new google.maps.LatLng(SW.lat(), 0.0);
mapPolygonOverlayPaths = [NE, NC, NW, SW, SC, SE];
}
fe...@gmail.com <fe...@gmail.com> #16
A am looking for a REAL mousemove event handler returning Lat/Lon coordinates, not
some pathetic kludge.
some pathetic kludge.
da...@google.com <da...@google.com> #17
Amen, brother!
de...@softec.lu <de...@softec.lu> #18
Berry,
I'd like an official Map event handler from Google as well, but for now, mine is the
best solution. You might call it pathetic kludge, but at least it works in all
browsers--yours does not. I'd say mine is the only non-pathetic kludge on this page.
I'd like an official Map event handler from Google as well, but for now, mine is the
best solution. You might call it pathetic kludge, but at least it works in all
browsers--yours does not. I'd say mine is the only non-pathetic kludge on this page.
Description
different values since its not evenly spreaded.
Making this feature available in v3 will make it possible for MarkerManager
to work, and perhaps there are more applications who really need this. I've
talked to Berry Ratliff and he has had limited succes in implementing his
own version.
The implementation of Berry can been seen here: