[OpenLayers-Users] Re: To display pop up image when click

Michael Ryan mr at mry4n.net
Fri May 4 10:23:08 EDT 2012


Hello,

I'm not exactly sure how you're adding the points (AJAX, GML file,
scraping with javascript, etc.), but remember you can put anything in
a pop-up.

If you want an image in the pop-up, you'll need an img tag. If you
want an image that corresponds to a particular point or parcel, one
strategy is that you have a directory of images that have names which
correspond to the titles.

So, if you have points with titles A, B, C, then in your image
directory you have images A.png, B.png, C.png. In your programming
where you populate the pop-up, where the image tag goes you'd have:

<img src="/path-to-images-directory/" + title + ".png />

-Mike


More information about the Users mailing list