Hi guys,
I think there was a sampe of this before but I can't seem to find it. How do I print a OpenStreetMapOverlay to a PdfGeoCanvas?
Thanks,
.Ryan.
Hi guys,
I think there was a sampe of this before but I can't seem to find it. How do I print a OpenStreetMapOverlay to a PdfGeoCanvas?
Thanks,
.Ryan.
Ryan,
Do you have sample foe PdfGeoCanvas? The sample shows how to get pdf document from an image, shape file or in memory feature source, you can use OpenStreetMapLayer do the same way.
Basically, you just need to prepare a PdfGeoCanvas, and input it to layer.Draw method.
Thanks,
James
Hi James,
Unfortunately I’m using OpenStreetMapOverlay which does not accept the drawing canvas as a parameter and I can’t set the OverlayCanvas property because PdfGeoCanvas is not of type Canvas.
.Ryan.
Ryan,
Could you tell me what different between OpenStreetMapOverlay and OpenStreetMapLayer, you can Create a LayerOverlay and add OpenStreetMapLayer to it, it will be the same as OpenStreetMapOverlay. If you have to use OpenStreeMapOverlay, it’s difficult to print it to pdf document. You probably need to override PdfGeoCanvas and add a method input overlay.
PdfGeoCanvas is inherit from GeoCanvas which is not Canvas, so that you couldn’t set it to OverlayCanvas, sorry for inconvenience.
James
Thanks James,
I was just using overlay because it was less code than creating a LayerOverlay and layer etc… I changed to use the OpenStreetMapLayer and everything works fine.
.Ryan.
Ryan,
That makes sense, but for this scenario you only can use layer rather than overlay, that’s the reason we provide both layer and overlay for some special map, also you can find GoogleOverlay, GoogleLayer and Bing etc.
Let me know if you have more questions.
James