Hi all- I was working on the polyline encoding utility last night and realized that using a GPolygon to indicate a selected marker is much easier than creating special icons (new GMarker objects) for a selected marker. I thought it would be slow when used with the marker drag event, but after testing on IE, Safari, and FF, it seems to work smoothly. I put together a simple example here: http://maps.examples.googlepages.com/highlightmarker.html It basically uses the code from my blog post example plus the code from the marker example on the documentation, plus a few extra lines. Just thought I'd put the idea out there. Let me know if you see any issues with the example.
It's a pity that Google have now pushed v2.72 without fixing the marker dragging bug (the second bug listed on the Known/Possible API bugs page) so your example now throws Javascript errors.
In MSIE6, the error is 'undefined' is null or not an object Line 601, char 59 and the marker dragend animation fails, leaving the dragged marker floating 13 pixels above the dragcross.
I didn't realize IE was throwing errors as well, but you're correct. I must have not tested dragging in IE. I'll see if I can get rid of the IE error somehow, I don't think that's the same as the FF bug. Thanks for catching that.
They do know about the Firefox dragging error, it should be fixed in a release soon.
On Feb 8, 3:25 am, Mike Williams <nos...@econym.demon.co.uk> wrote:
> It's a pity that Google have now pushed v2.72 without fixing the marker > dragging bug (the second bug listed on the Known/Possible API bugs page) > so your example now throws Javascript errors.
> In MSIE6, the error is > 'undefined' is null or not an object > Line 601, char 59 > and the marker dragend animation fails, leaving the dragged marker > floating 13 pixels above the dragcross.
http://www.google.com/apis/maps/documentation/dragmarker.html produces the same result. I didn't realize the dragging error caused that sort of break in the execution in IE6. That's certainly more of a concern than the FF error that doensn't stop the dragging. (They may well be the same error). I'll forward this on. Thanks for the catch, Mike.
<api.pamela...@google.com> wrote: > I didn't realize IE was throwing errors as well, but you're correct. I > must have not tested dragging in IE. > I'll see if I can get rid of the IE error somehow, I don't think > that's the same as the FF bug. Thanks for catching that.
> They do know about the Firefox dragging error, it should be fixed in a > release soon.
> On Feb 8, 3:25 am, Mike Williams <nos...@econym.demon.co.uk> wrote:
> > That's pretty neat.
> > It's a pity that Google have now pushed v2.72 without fixing the marker > > dragging bug (the second bug listed on the Known/Possible API bugs page) > > so your example now throws Javascript errors.
> > In MSIE6, the error is > > 'undefined' is null or not an object > > Line 601, char 59 > > and the marker dragend animation fails, leaving the dragged marker > > floating 13 pixels above the dragcross.
Addendum: I keep forgetting that the documentation examples use version 2, and I frequently use 2 in my examples. That bug is fixed in 2.x (2.73). I'll change the version #.
<api.pamela...@google.com> wrote: > http://www.google.com/apis/maps/documentation/dragmarker.htmlproduces > the same result. > I didn't realize the dragging error caused that sort of break in the > execution in IE6. > That's certainly more of a concern than the FF error that doensn't > stop the dragging. > (They may well be the same error). > I'll forward this on. Thanks for the catch, Mike.
> On Feb 8, 3:41 am, "pamela (Google Employee)"
> <api.pamela...@google.com> wrote: > > I didn't realize IE was throwing errors as well, but you're correct. I > > must have not tested dragging in IE. > > I'll see if I can get rid of the IE error somehow, I don't think > > that's the same as the FF bug. Thanks for catching that.
> > They do know about the Firefox dragging error, it should be fixed in a > > release soon.
> > On Feb 8, 3:25 am, Mike Williams <nos...@econym.demon.co.uk> wrote:
> > > That's pretty neat.
> > > It's a pity that Google have now pushed v2.72 without fixing the marker > > > dragging bug (the second bug listed on the Known/Possible API bugs page) > > > so your example now throws Javascript errors.
> > > In MSIE6, the error is > > > 'undefined' is null or not an object > > > Line 601, char 59 > > > and the marker dragend animation fails, leaving the dragged marker > > > floating 13 pixels above the dragcross.
Mike, can you check the example now? (reload) I'm planning on using this type of highlighting in several map apps I'm working on, and I appreciate your feedback on improving it. Thanks!
<api.pamela...@google.com> wrote: > Addendum: I keep forgetting that the documentation examples use > version 2, and I frequently use 2 in my examples. That bug is fixed in > 2.x (2.73). I'll change the version #.
> On Feb 8, 3:47 am, "pamela (Google Employee)"
> <api.pamela...@google.com> wrote: > >http://www.google.com/apis/maps/documentation/dragmarker.htmlproduces > > the same result. > > I didn't realize the dragging error caused that sort of break in the > > execution in IE6. > > That's certainly more of a concern than the FF error that doensn't > > stop the dragging. > > (They may well be the same error). > > I'll forward this on. Thanks for the catch, Mike.
> > On Feb 8, 3:41 am, "pamela (Google Employee)"
> > <api.pamela...@google.com> wrote: > > > I didn't realize IE was throwing errors as well, but you're correct. I > > > must have not tested dragging in IE. > > > I'll see if I can get rid of the IE error somehow, I don't think > > > that's the same as the FF bug. Thanks for catching that.
> > > They do know about the Firefox dragging error, it should be fixed in a > > > release soon.
> > > On Feb 8, 3:25 am, Mike Williams <nos...@econym.demon.co.uk> wrote:
> > > > That's pretty neat.
> > > > It's a pity that Google have now pushed v2.72 without fixing the marker > > > > dragging bug (the second bug listed on the Known/Possible API bugs page) > > > > so your example now throws Javascript errors.
> > > > In MSIE6, the error is > > > > 'undefined' is null or not an object > > > > Line 601, char 59 > > > > and the marker dragend animation fails, leaving the dragged marker > > > > floating 13 pixels above the dragcross.
<api.pamela...@google.com> wrote: > Hi all- > I was working on the polyline encoding utility last night and realized > that using a GPolygon to indicate a selected marker is much easier > than creating special icons (new GMarker objects) for a selected > marker. I thought it would be slow when used with the marker drag > event, but after testing on IE, Safari, and FF, it seems to work > smoothly. > I put together a simple example here:http://maps.examples.googlepages.com/highlightmarker.html > It basically uses the code from my blog post example plus the code > from the marker example on the documentation, plus a few extra lines. > Just thought I'd put the idea out there. Let me know if you see any > issues with the example.
It seems like a GPolygon created by clicking points could do that. I don't think the code in this example is particularly helpful. I've got another example that uses the classic drag-a-div-with-a-border to select markers, but of course the advantage of a GPolygon is that it can be of arbitrary shape. A non-rectangle is harder to look for markers within, but I believe we've had discussions here about the math functions required to do that. Are you up to tackling it, or should I put it on my to-do list? :)
On Feb 8, 4:12 am, "mapp...@googlemail.com" <mapp...@googlemail.com> wrote:
> <api.pamela...@google.com> wrote: > > Hi all- > > I was working on the polyline encoding utility last night and realized > > that using a GPolygon to indicate a selected marker is much easier > > than creating special icons (new GMarker objects) for a selected > > marker. I thought it would be slow when used with the marker drag > > event, but after testing on IE, Safari, and FF, it seems to work > > smoothly. > > I put together a simple example here:http://maps.examples.googlepages.com/highlightmarker.html > > It basically uses the code from my blog post example plus the code > > from the marker example on the documentation, plus a few extra lines. > > Just thought I'd put the idea out there. Let me know if you see any > > issues with the example.
>Mike, can you check the example now? (reload) >I'm planning on using this type of highlighting in several map apps >I'm working on, and I appreciate your feedback on improving it. >Thanks!
Moving to v2.73 does solve the bug.
Another little thing you might like to do to improve the example would be to recalculate the size of the polygon when the zoom changes. It looks a little bit silly if you zoom in five or six levels without happening to mouseover a marker (which would redraw the polygon at a suitable size for the new zoom level).
I'll be adding that in. I noticed it myself in the other app I've been using it for where I actually had a desire to zoom in/out. Should be fixed within the hour. Thanks! :)
On Feb 8, 6:18 am, Mike Williams <nos...@econym.demon.co.uk> wrote:
> >Mike, can you check the example now? (reload) > >I'm planning on using this type of highlighting in several map apps > >I'm working on, and I appreciate your feedback on improving it. > >Thanks!
> Moving to v2.73 does solve the bug.
> Another little thing you might like to do to improve the example would > be to recalculate the size of the polygon when the zoom changes. > It looks a little bit silly if you zoom in five or six levels without > happening to mouseover a marker (which would redraw the polygon at a > suitable size for the new zoom level).