[OpenLayers-Users] Google maps layer with SVG overlay

hhudson at katmandu.org hhudson at katmandu.org
Sun Jul 24 08:44:39 EDT 2011


Hi,

You might want to try the Layer.InlineXhtml class and possibly consider
setting singleTile to true in the options.

Eg,

  var svg_layer = new OpenLayers.Layer.InlineXhtml(
   "SVG overlay",
   "<url_to_your_php_script>",
   null,
   {singleTile: true} );

Amongst other paramters, this will pass BBOX to your php script.  Also,
your php script will need to be from same origin or use a proxy mechanism.

Regards,

Harris.

> Dear OpenLayers community,
>
> I have an OpenLayers map with the following layers in the layer switcher:
> Google Physical
> Google Streets
> Google Hybrid
> Google Satellite
> Open Street Map
>
> I would like to add a dynamically generated SVG overlay.
> The SVG will be generated server side by PHP.
> SVG will not be WMS it will be generated by php based on the bounding box
> of
> the current map view.
> I was looking at the Xhtml addin because i need the SVG objects to respond
> to mouse events.
>
> I tried testing this using static SVG based on the examples from the
> inlineXhtml addin however I was unable to successfully display any SVG
> over
> the existing map layers.
>
> I was looking at this example:
> http://dev.openlayers.org/addins/InlineXhtml/trunk/examples/example3.htm
> http://dev.openlayers.org/addins/InlineXhtml/trunk/examples/example3.htm
> However this has a scalable layer with fixed bounds.
> Since my layer will be generated dynamically based on the Bounding Box of
> the current map view it doesn't have fixed bounds and does not need to be
> scalable.
>
> Can anyone point me to an example of this?
>
> Thank you
>
> br
> James
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Google-maps-layer-with-SVG-overlay-tp6609380p6609380.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>




More information about the Users mailing list