본문 바로가기

develop/web GIS11

OpenLayers addfeatures(json) 에서 json형식 java에서 만들기 public class IndexControl {IndexCode indexCode ;SbbDBMapper sbbMapper;public List getIndexCode(HttpServletResponse response) throws Exception {DBUtils dbUtils = new DBUtils();List getIndex = dbUtils.selectList(DB.SBB_DB, "getIndexCode"); JSONObject jsonObj= new JSONObject();JSONObject jsonObj1= new JSONObject();JSONObject jsonObj2= new JSONObject();JSONObject jsonObj3= new JSONObject();JSONArray.. 2014. 11. 17.
레이어 클릭시 이벤트 발생 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), rest.. 2014. 11. 16.
마커 생성 및 라벨 수정 sprintersLayer = new OpenLayers.Layer.Vector('해양기후', { styleMap: new OpenLayers.StyleMap({ externalGraphic: '../js/OpenLayers/img/marker.png', graphicOpacity: 1.0, graphicWith: 16, graphicHeight: 26, graphicYOffset: -26, fontColor: "red", fontSize: "12px", fontFamily: "Courier New, monospace", fontWeight: "bold" }) });sprintersLayer.addFeatures(getSprintersFeatures());sprintersLayer.id="sprinter.. 2014. 11. 14.
좌표로 폴리곤 표현 var points = [ new OpenLayers.Geometry.Point(14362056.075118,4235599.8183829), new OpenLayers.Geometry.Point(14112565.61484,4324266.7711779), new OpenLayers.Geometry.Point(14147420.899732,4354230.0862603),];var ring = new OpenLayers.Geometry.LinearRing(points);var polygon = new OpenLayers.Geometry.Polygon([ring]); // create some attributes for the featurevar attributes = {name: "my name", bar: ".. 2014. 11. 14.
좌표에 해당하는 마커 및 팝업 표현 Example of FeaturePopups for OpenLayers: External div as a popup View on GitHub popups, vector layers, templates Demonstrates how to use the "FeaturePopups" control to display popups on multiple vector layers using templates. View the feature-popups-external.js source to see how this is done. (see also feature-popups-common.js) 2014. 11. 14.