dan
dan

Reputation: 45632

Is it possible to layer an SVG with a transparent background over a Google Map?

Instead of the using Google Map's polyline API, is it possible to layer an SVG image over the map with a library like d3?

Are there any examples of this in the wild?

Upvotes: 0

Views: 2234

Answers (2)

martins
martins

Reputation: 431

It is not possible for some time because of bug in GoogleMaps. If SVG is large (car route), svg disappear from some zoom level in some browsers (namely Opera 12+ and iPad Safari). Polyline works fine in all browsers a and same SVG in same zoom works fine when tested outside GoogleMaps.

Upvotes: 0

martin
martin

Reputation: 2493

Yes, of course it is possible. In regards to any examples in the wild, Google has an example of creating a custom overlay using an image. If you want to use SVG or even Canvas then there is really no difference you can manipulate the DOM in any way you please :)

Upvotes: 1

Related Questions