OpenLayers 오픈레이어에서 마우스 클릭 위치 좌표값 가져오는 여러가지 방법 > 개발

본문 바로가기
사이트 내 전체검색

개발

OpenLayers 오픈레이어에서 마우스 클릭 위치 좌표값 가져오는 여러가지 방법

페이지 정보

profile_image
작성자 관리자 (61.♡.26.29)
댓글 0건 조회 5,913회 작성일 17-04-22 22:57

본문

오픈레이어로 지도 작업할 때, 지도위에 마우스를 클릭한 위치의 좌표값을 알아내는 방법들이다.

[code]
feature.geometry.getBounds().getCenterLonLat()
[/code]
or

[code]
map.events.register("click", map, function(e) {
    var latlon = map.getLonLatFromViewPortPx(e.xy) ;
    alert(lonlat);
});
[/code]
or

[code]
new OpenLayers.Control.SelectFeature(layer,{
    hover:true,
    eventListeners:{
      onSelect:function(e){
        alert(e.feature.geometry)
    }
});
[/code]
or

[code]
layer.events.on({
            "featureselected": function(e) {     
            alert(e);
            }
});   
[/code]



** 출처 : https://gis.stackexchange.com/questions/22240/openlayers-selectfeature-get-mouse-position

추천0

댓글목록

등록된 댓글이 없습니다.

Total 386건 1 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
386316004-07
385479011-04
384486012-03
383515011-26
382876012-10
381995001-09
3801074009-08
3791089012-15
3781116004-12
3771133002-02
3761201012-25
3751211007-03
3741267004-10
3731283007-27
3721344008-11
3711396008-11
3701409003-22
3691423004-20
3681426008-10
3671432004-23

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.