Hi,
Could you provide some information on how to build beautiful popups ?
thanks?
Hi,
Could you provide some information on how to build beautiful popups ?
thanks?
JM,
There are two options:
1. Add popup on client:
function showPopup(){
var popup = new OpenLayers.Popup.FramedCloud("popupid",
new OpenLayers.LonLat(5,78),
new OpenLayers.Size(200,200),
" contentHTML ",
null,
true);
Map1.GetMapParser().map.addPopup(popup);
}
More online sample see here: openlayers.org/dev/examples/popupMatrix.html
OpenLayer’s popup API: dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Popup-js.html
2. Using Popup at server side: two popup classes “CloudPopup” and “CustomPopup” could be used. Please use the following constructors.
public CloudPopup(string id, PointShape position, string contentHtml, int width, int height, bool autoPan, bool hasCloseButton)
public CustomPopup(string id, PointShape position, string contentHtml, int width, int height, bool autoPan, bool hasCloseButton, int borderWidth)
The most important one is the contentHtml, which means You can include any HTML properties you wish in the ContentHtml of your Popup, including 'background-color' or even adding css class.
Hope it helps
Johnny