map = new OpenLayers.Map('map',{
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
tileSize : new OpenLayers.Size(256,256),
numZoomLevels:19,
allOverlays : true,
eventListeners: {
featureclick: function(e) {
layerData(e);
}
},
maxResolution: 156543.0339,
tileOrigin : new OpenLayers.LonLat(-20037508.34, -20037508.34),
restrictedExtent : new OpenLayers.Bounds(13596081.15422, 3759090.50573, 14784829.81794, 4982082.95812),
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
controls : []
});
//이벤트 핸들
function layerData(e) {
var name = e.feature.attributes.Name;
var Country = e.feature.attributes.Country;
var City = e.feature.attributes.City;
var html = "";
html += " <div id='divList' style='float:left; min-width: 200px; margin-left: 6px'>";
html += "<b>Name : </b>"+name+"</BR>";
html += "<b>Country : </b>"+Country+"</BR>";
html += "<b>City : </b>"+City+"</BR>";
html += "</div> ";
$("#divList").html(html);
}
'develop > web GIS' 카테고리의 다른 글
EPSG:4326 to EPSG:900913 transform (0) | 2014.11.19 |
---|---|
OpenLayers addfeatures(json) 에서 json형식 java에서 만들기 (0) | 2014.11.17 |
마커 생성 및 라벨 수정 (0) | 2014.11.14 |
좌표로 폴리곤 표현 (0) | 2014.11.14 |
좌표에 해당하는 마커 및 팝업 표현 (0) | 2014.11.14 |