-1

Google Map Store Locator

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

Examples : 1) https://storelocator.googlecode.com/git/examples/panel.html

2) https://storelocator.googlecode.com/git/examples/dynamic.html

I want to create the storelocator dynamically from the cfquery

is it possible to create storelocator in coldfusion?

can anyone help me out?

<cfquery name="qCompany" datasource="#application.dsn#">
    select  
    name, 
    addrress, 
    city, 
    state, 
    zip, 
    country, 
    phone, 
    latitude,
    longitude
    from    wcountry_company    
</cfquery>
mDEV123
  • 31
  • 6
  • 1
    Have you tried anything? are you getting any errors or unexpected results? have you looked at the API? – genericHCU Nov 15 '12 at 12:59
  • I have tried using the JSON data & javascript objects and posted the examples, what i'm looking for. – mDEV123 Nov 15 '12 at 13:55

2 Answers2

0

Storelocator API is in javascript so you have to use <script> to use it and then you can build objects with your query in a loop:

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

But I don't know storelocator enough to help you more with javascript objects.

Cedrun
  • 457
  • 2
  • 8
0

I took an example I use for a store locator that I use.

First get a googlemapkey (not sure if they still make you sign up for them) Then I would suggest making a form where they can query by state and then filter your query by state below...

Also, if you want to add a zipcode lookup, here is a good example here with a sample database to use for data.

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

There are a few of them online but this seems to be neatly packaged for use.

<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>
steve
  • 1,490
  • 10
  • 18