2012-11-15 2 views
-1

구글지도 매장 검색구글지도 매장 검색 ColdFusion에서

https://code.google.com/p/storelocator/

예를 들어 1) https://storelocator.googlecode.com/git/examples/panel.html

2)이 cfquery 등

에서 동적으로 매장 검색을 만들 https://storelocator.googlecode.com/git/examples/dynamic.html

storelocator i를 만드는 것이 가능합니다. n coldfusion?

누구든지 나를 도울 수 있습니까?

<script> 
    <cfoutput query="qCompany"> 
     Building javascript objects 
    </cfouput> 
</script> 

하지만에 충분한 매장 검색을 모르는 : 당신이 그것을 사용하는 <script>를 사용할 필요가 다음 루프에서 쿼리 객체를 구축 할 수 있도록

<cfquery name="qCompany" datasource="#application.dsn#"> 
    select 
    name, 
    addrress, 
    city, 
    state, 
    zip, 
    country, 
    phone, 
    latitude, 
    longitude 
    from wcountry_company  
</cfquery> 
+1

아무 것도 시도해 보지 않으셨습니까? 어떤 오류나 예기치 않은 결과가 있습니까? 당신이 API를 보셨나요? – Travis

+0

JSON 데이터 및 자바 스크립트 개체를 사용해 보았습니다. 예를 찾고 싶습니다. – mDEV123

답변

0

매장 검색 API는 자바 스크립트입니다 javascript 객체로 더 많은 것을 도와주세요.

0

나는 내가 사용하는 매장 검색 기능에 사용하는 예제를 사용했습니다.

먼저 그런 다음 나는 그들이 아래 상태하여 쿼리를 필터링 한 후 국가에 의해 쿼리 수있는 양식을 제안 (그들은 여전히 ​​당신이 그들에 가입 할 경우 확실하지) ... googlemapkey를 얻을 수

또한 우편 번호 조회를 추가하려는 경우 여기에 데이터 용 샘플 데이터베이스가있는 좋은 예가 있습니다.

http://jonathonwallen.blogspot.com/2011/08/zip-code-radius-search-store-locator-in.html

온라인 그들 중 몇 가지가 있지만이 깔끔하게 사용하기 위해 포장 것으로 보인다.

<cfajaximport params="#{googlemapkey='*KEY HERE*'}#"> 
</cfif> 


<cfquery name="qCompany" datasource="#application.dsn#"> 
    select 
    name, 
    addrress, 
    city, 
    state, 
    zip, 
    country, 
    phone, 
    latitude, 
    longitude 
    from wcountry_company  
</cfquery> 

<cfmap name="gmap02" 
    centeraddress="#form.zipcode#" <!--- or state if your querying by state ---> 
    doubleclickzoom="true" 
    scrollwheelzoom="true" 
    showscale="false" 
    tip="My Map" 
    width="1000" 
    height="800" 
    zoomlevel="15"> 

    <cfoutput query="qCompany"> 
    <cfmapitem address="#address# #city#, #state# #zip#" name="gmap02" tip="#name# #address# #city#, #state# #zip#" markerwindowcontent="#address#<br>#city#<br>#state#<br> #zip#" /> 
    </cfoutput> 


</cfmap>