2010-02-13 2 views

답변

2

IP를 실제 위치에 매핑하는 hostip.info과 같은 서비스를 사용해야하며 작업을 단순화하기 위해 개발자에게 API을 제공해야합니다.

Google에는 무료 및 유료 서비스가 많이 있습니다.

4

jsp 또는 무엇을 사용하고 있습니까? 클라이언트 측의 도시 이름은 IP로 매핑 된 사용자의 지리적 세부 정보를 반환하는 Google의 API를 사용할 수 있습니다. 구글의 문서로서 당신이 얻을 수있는 말을 다음

채워 때, google.loader.ClientLocation 객체는 다음 메트로 레벨 세분화 속성으로 채워집니다 : 더 참조

* ClientLocation.latitude — supplies the low resolution latitude associated with the client's IP address 
* ClientLocation.longitude — supplies the low resolution longitude associated with the client's IP address 
* ClientLocation.address.city — supplies the name of the city associated with the client's IP address 
* ClientLocation.address.country — supplies the name of the country associated with the client's IP address 
* ClientLocation.address.country_code — supplies the name of the ISO 3166-1 country code associated with the client's IP address 
* ClientLocation.address.region — supplies the country specific region name associated with the client's IP address 

http://code.google.com/apis/ajax/documentation/에서 전체 설명서를 참조하십시오

+0

예 JSP 코드 infact JSF를 사용하고 있습니다. 빠른 응답을 주셔서 감사합니다. 코드 스 니펫을 제공하면 도움이 될 것입니다. –

1

다른 API가 제안한 온라인 API가 귀하의 응용 프로그램과 맞지 않는다면 이전에 성공적으로 Java API와 함께 제공되는 MaxMind GeoLite City을 사용했습니다. 데이터베이스 파일을 다운로드하고 API 코드를 가리키면됩니다. 간단하고 간단합니다.

+0

이 서비스는 유료입니다. 그렇다면 무료 서비스를 제안하십시오. just-flick.com – Pedantic