Hi David, This is an interesting idea. Since we support browsers that lack Canvas, we usually try to avoid exposing Canvas in the public interfaces. And there *is* a workaround (toDataURL) though it's not ideal as you say. So I suggest using the workaround for now, and we'll look into supporting this down the road.
If you haven't already, please file a feature request here: http://code.google.com/p/gmaps-api-issues/issues/list?can=2&q=apitype:Javascript3%20type:Enhancement&sort=-stars&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars That's the easiest way to track progress. Thanks Ben On Sun, Dec 18, 2011 at 6:37 PM, David Karger <david.kar...@gmail.com>wrote: > I'm revising a web application (http://simile-widgets.org/exhibit) to > generate relatively complex marker icons using canvas. In particular, I > need to be able to specify an image (via a url), but also to crop that > image to a shape that I draw. For reasons detailed below, it would be > very useful if I could specify those markers to gmaps by passing the canvas > itself instead of passing a (data) url. > > Since gmaps requires marker icons to be specified as urls, I'm using the > canvas.toDataURL method to create one. This has always seemed rather > hacky, since gmaps turns around and paints that dataurl onto its canvas. > But now I've run into a more serious flaw. Some of my markers embed images > drawn from other sites (I draw those images onto my canvas). Such > cross-site image rendering is permitted. But, the canvas to which the > image is rendered becomes "tainted"---out of fear that I could improperly > access images from another site, I am no longer permitted to look at the > canvas. In particular, it becomes forbidden to generate a data url from > the canvas. So I can't hand it off to gmaps. If I could pass the canvas > instead, gmaps could render it for me---it wouldn't matter that the map > itself becomes tainted. > > alternatively, I could also accomplish this if it were possible to give > gmaps _both_ a marker shape _and_ and image url, with the understanding > that the image should be painted into the marker shape. > > Given that direct handoff of a canvas is more natural than the transform > to/from a data url, I hope such a feature might be considered. > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-maps-js-api-v3/-/oUyZtoEYSuQJ. > To post to this group, send email to > google-maps-js-api-v3@googlegroups.com. > To unsubscribe from this group, send email to > google-maps-js-api-v3+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.