Posted on 05/03/2014 12:05:57
Hi,
with that filter code I have this result:
http://scolopi.net.dynamicweb-cms.com/Default.aspx?ID=791&Purge=True
Only "Show all" button works.
Also I would show the country list in a select box instead of buttons...
Please take a look at my code below and tell me where is the error and how I can create a filter on a select box like this:
http://www.geocodezip.com/zoom2countrySelectList.html
Thank you.
Best regards,
Giuseppina
p.s. This code provides basic functions so you could add it as a useful DW maps template ...
<div class="dynamicweb-map" id="<!--@ElementID-->" data-list-position="<!--@ListPosition-->">
<form class="search">
<div>
<label for="dynamicweb-map-adr"><!--@Translate(Address, 'Address', Global)--></label>
<input type="text" size="70" id="dynamicweb-map-adr" name="adr" placeholder="Address …" value="<!--@If Defined(Server:Request.adr)--><!--@Server:Request.adr--><!--@EndIf(Server:Request.adr)-->"/>
<label for="dynamicweb-map-dst"><!--@Translate(Distance, 'Distance', Global)--></label>
<select id="dynamicweb-map-dst" name="dst">
<option value="1000">1 km</option>
<option value="2000">2 km</option>
<option value="4000">4 km</option>
<option value="8000">8 km</option>
<option value="16000">16 km</option>
<option value="32000">32 km</option>
</select>
<button type="submit" data-search="distance"><!--@Translate(Search, 'Search', Global)--></button>
<button type="reset"><!--@Translate(Reset_search, 'Reset search', Global)--></button>
<button type="button" class="show-all-locations"><!--@Translate(Show_all_groups, 'Show all locations', Global)--></button>
</div>
</form>
<div class="map" style="width: <!--@MapWidth-->; height: <!--@MapHeight-->;">
<div id="<!--@MapElementID-->"></div>
</div>
<!--@LoopStart(UserGroups)-->
<!--@HeaderStart-->
<div class="group-filter user-Name" style="height:560px;">
<!--@HeaderEnd-->
<button class="buttonmap" data-group-id="<!--@ID-->">
<!--@If Defined(Icon)--><img class="icon" src="<!--@Icon-->" /><!--@EndIf(Icon)-->
<!--@Name--></button>
<!--@FooterStart-->
</div>
<!--@FooterEnd-->
<!--@LoopEnd(UserGroups)-->
<div class="list">
<ol id="<!--@ListElementID-->">
<!--@LoopStart(Locations)-->
<li data-lat="<!--@Lat-->" data-lng="<!--@Lng-->" data-title="<!--@Name-->"
data-group-id="<!--@GroupID-->"
<!--@If Defined(Icon)--> data-icon="<!--@Icon-->"<!--@EndIf(Icon)-->>
<div class="name" style="size:16px;line-height:21px;"><strong><!--@Name--></strong></div>
<!--@If(0=1)-->@see http://microformats.org/wiki/adr<!--@EndIf-->
<div class="adr" style="size:16px;line-height:21px;">
<div class="street-address"><!--@Address--></div>
<div class="extended-address"><!--@Address2--></div>
<span class="postal-code"><!--@Zip--></span>
<!--@If Defined(Custom.AccessUser_City_Code)--><span class="locality"><!--@Custom.AccessUser_City_Code--></span><!--@EndIf(Custom.AccessUser_City_Code)-->
<!--@If Defined(Custom.AccessUser_PostalBox)--><span class="locality"><!--@Custom.AccessUser_PostalBox--></span><!--@EndIf(Custom.AccessUser_PostalBox)-->
<span class="locality"><!--@City--></span>
<div class="country-name"><!--@Country--></div>
<!--@If Defined(Phone)--><div class="Phone">Tel:<!--@Phone--></div><!--@EndIf(Phone)-->
<!--@If Defined(PhoneMobile)--><div class="Phone"><!--@PhoneMobile--></div><!--@EndIf(PhoneMobile)-->
<!--@If Defined(PhonePrivate)--><div class="Phone"><!--@PhonePrivate--></div><!--@EndIf(PhonePrivate)-->
<!--@If Defined(Fax)--><div class="Phone">Fax:<!--@Fax--></div><!--@EndIf(Fax)-->
<!--@If Defined(Custom.AccessUser_Web)--><div class="locality">Web:<!--@Custom.AccessUser_Web--></div><!--@EndIf(Custom.AccessUser_Web)-->
</div>
</li>
<!--@LoopEnd(Locations)-->
</ol>
</div>
<li data-filter-value="<!--@Country-->"> Select a country </li>
<div class="locations-filter">
<button data-filter-value="Afghanistan">Afghanistan</button><button data-filter-value="Albania">Albania</button><button data-filter-value="Algeria">Algeria</button><button data-filter-value="American Samoa">American Samoa</button><button data-filter-value="Andorra">Andorra</button><button data-filter-value="Angola">Angola</button><button data-filter-value="Anguilla">Anguilla</button><button data-filter-value="Antarctica">Antarctica</button><button data-filter-value="Antigua and Barbuda">Antigua and Barbuda</button><button data-filter-value="Argentina">Argentina</button><button data-filter-value="Armenia">Armenia</button><button data-filter-value="Aruba">Aruba</button><button data-filter-value="Australia">Australia</button><button data-filter-value="Austria">Austria</button><button data-filter-value="Azerbaijan">Azerbaijan</button><button data-filter-value="Bahamas">Bahamas</button><button data-filter-value="Bahrain">Bahrain</button><button data-filter-value="Bangladesh">Bangladesh</button><button data-filter-value="Barbados">Barbados</button><button data-filter-value="Belarus">Belarus</button><button data-filter-value="Belgium">Belgium</button><button data-filter-value="Belize">Belize</button><button data-filter-value="Benin">Benin</button><button data-filter-value="Bermuda">Bermuda</button><button data-filter-value="Bhutan">Bhutan</button><button data-filter-value="Bolivia">Bolivia</button><button data-filter-value="Bosnia and Herzegovina">Bosnia and Herzegovina</button><button data-filter-value="Botswana">Botswana</button><button data-filter-value="Bouvet Island">Bouvet Island</button><button data-filter-value="Brazil">Brazil</button><button data-filter-value="British Indian Ocean Territory">British Indian Ocean Territory</button><button data-filter-value="Brunei Darussalam">Brunei Darussalam</button><button data-filter-value="Bulgaria">Bulgaria</button><button data-filter-value="Burkina Faso">Burkina Faso</button><button data-filter-value="Burundi">Burundi</button><button data-filter-value="Cambodia">Cambodia</button><button data-filter-value="Cameroon">Cameroon</button><button data-filter-value="Canada">Canada</button><button data-filter-value="Cape Verde">Cape Verde</button><button data-filter-value="Cayman Islands">Cayman Islands</button><button data-filter-value="Central African Republic">Central African Republic</button><button data-filter-value="Chad">Chad</button><button data-filter-value="Chile">Chile</button><button data-filter-value="China">China</button><button data-filter-value="Christmas Island">Christmas Island</button><button data-filter-value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</button><button data-filter-value="Colombia">Colombia</button><button data-filter-value="Comoros">Comoros</button><button data-filter-value="Congo">Congo</button><button data-filter-value="Congo, the Democratic Republic of the">Congo, the Democratic Republic of the</button><button data-filter-value="Cook Islands">Cook Islands</button><button data-filter-value="Costa Rica">Costa Rica</button><button data-filter-value="Cote D'Ivoire">Cote D'Ivoire</button><button data-filter-value="Croatia">Croatia</button><button data-filter-value="Cuba">Cuba</button><button data-filter-value="Cyprus">Cyprus</button><button data-filter-value="Czech Republic">Czech Republic</button><button data-filter-value="Denmark">Denmark</button><button data-filter-value="Djibouti">Djibouti</button><button data-filter-value="Dominica">Dominica</button><button data-filter-value="Dominican Republic">Dominican Republic</button><button data-filter-value="Ecuador">Ecuador</button><button data-filter-value="Egypt">Egypt</button><button data-filter-value="El Salvador">El Salvador</button><button data-filter-value="Equatorial Guinea">Equatorial Guinea</button><button data-filter-value="Eritrea">Eritrea</button><button data-filter-value="Estonia">Estonia</button><button data-filter-value="Ethiopia">Ethiopia</button><button data-filter-value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</button><button data-filter-value="Faroe Islands">Faroe Islands</button><button data-filter-value="Fiji">Fiji</button><button data-filter-value="Finland">Finland</button><button data-filter-value="France">France</button><button data-filter-value="French Guiana">French Guiana</button><button data-filter-value="French Polynesia">French Polynesia</button><button data-filter-value="French Southern Territories">French Southern Territories</button><button data-filter-value="Gabon">Gabon</button><button data-filter-value="Gambia">Gambia</button><button data-filter-value="Georgia">Georgia</button><button data-filter-value="Germany">Germany</button><button data-filter-value="Ghana">Ghana</button><button data-filter-value="Gibraltar">Gibraltar</button><button data-filter-value="Greece">Greece</button><button data-filter-value="Greenland">Greenland</button><button data-filter-value="Grenada">Grenada</button><button data-filter-value="Guadeloupe">Guadeloupe</button><button data-filter-value="Guam">Guam</button><button data-filter-value="Guatemala">Guatemala</button><button data-filter-value="Guinea">Guinea</button><button data-filter-value="Guinea-Bissau">Guinea-Bissau</button><button data-filter-value="Guyana">Guyana</button><button data-filter-value="Haiti">Haiti</button><button data-filter-value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</button><button data-filter-value="Holy See (Vatican City State)">Holy See (Vatican City State)</button><button data-filter-value="Honduras">Honduras</button><button data-filter-value="Hong Kong">Hong Kong</button><button data-filter-value="Hungary">Hungary</button><button data-filter-value="Iceland">Iceland</button><button data-filter-value="India">India</button><button data-filter-value="Indonesia">Indonesia</button><button data-filter-value="Iran, Islamic Republic of">Iran, Islamic Republic of</button><button data-filter-value="Iraq">Iraq</button><button data-filter-value="Ireland">Ireland</button><button data-filter-value="Israel">Israel</button><button data-filter-value="Italy">Italy</button><button data-filter-value="Jamaica">Jamaica</button><button data-filter-value="Japan">Japan</button><button data-filter-value="Jordan">Jordan</button><button data-filter-value="Kazakhstan">Kazakhstan</button><button data-filter-value="Kenya">Kenya</button><button data-filter-value="Kiribati">Kiribati</button><button data-filter-value="Korea, Democratic People's Republic of">Korea, Democratic People's Republic of</button><button data-filter-value="Korea, Republic of">Korea, Republic of</button><button data-filter-value="Kuwait">Kuwait</button><button data-filter-value="Kyrgyzstan">Kyrgyzstan</button><button data-filter-value="Lao People's Democratic Republic">Lao People's Democratic Republic</button><button data-filter-value="Latvia">Latvia</button><button data-filter-value="Lebanon">Lebanon</button><button data-filter-value="Lesotho">Lesotho</button><button data-filter-value="Liberia">Liberia</button><button data-filter-value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</button><button data-filter-value="Liechtenstein">Liechtenstein</button><button data-filter-value="Lithuania">Lithuania</button><button data-filter-value="Luxembourg">Luxembourg</button><button data-filter-value="Macao">Macao</button><button data-filter-value="Macedonia, the Former Yugoslav Republic of">Macedonia, the Former Yugoslav Republic of</button>
<button data-filter-value="Madagascar">Madagascar</button><button data-filter-value="Malawi">Malawi</button><button data-filter-value="Malaysia">Malaysia</button><button data-filter-value="Maldives">Maldives</button>
<button data-filter-value="Mali">Mali</button><button data-filter-value="Malta">Malta</button><button data-filter-value="Marshall Islands">Marshall Islands</button>
<button data-filter-value="Martinique">Martinique</button><button data-filter-value="Mauritania">Mauritania</button>
<button data-filter-value="Mauritius">Mauritius</button><button data-filter-value="Mayotte">Mayotte</button><button data-filter-value="Mexico">Mexico</button>
<button data-filter-value="Micronesia, Federated States of">Micronesia, Federated States of</button><button data-filter-value="Moldova, Republic of">Moldova, Republic of</button><button data-filter-value="Monaco">Monaco</button><button data-filter-value="Mongolia">Mongolia</button><button data-filter-value="Montserrat">Montserrat</button><button data-filter-value="Morocco">Morocco</button><button data-filter-value="Mozambique">Mozambique</button><button data-filter-value="Myanmar">Myanmar</button><button data-filter-value="Namibia">Namibia</button><button data-filter-value="Nauru">Nauru</button><button data-filter-value="Nepal">Nepal</button><button data-filter-value="Netherlands">Netherlands</button><button data-filter-value="Netherlands Antilles">Netherlands Antilles</button><button data-filter-value="New Caledonia">New Caledonia</button><button data-filter-value="New Zealand">New Zealand</button><button data-filter-value="Nicaragua">Nicaragua</button><button data-filter-value="Niger">Niger</button><button data-filter-value="Nigeria">Nigeria</button><button data-filter-value="Niue">Niue</button><button data-filter-value="Norfolk Island">Norfolk Island</button><button data-filter-value="Northern Mariana Islands">Northern Mariana Islands</button><button data-filter-value="Norway">Norway</button><button data-filter-value="Oman">Oman</button><button data-filter-value="Pakistan">Pakistan</button><button data-filter-value="Palau">Palau</button><button data-filter-value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</button><button data-filter-value="Panama">Panama</button><button data-filter-value="Papua New Guinea">Papua New Guinea</button><button data-filter-value="Paraguay">Paraguay</button><button data-filter-value="Peru">Peru</button><button data-filter-value="Philippines">Philippines</button><button data-filter-value="Pitcairn">Pitcairn</button><button data-filter-value="Poland">Poland</button><button data-filter-value="Portugal">Portugal</button><button data-filter-value="Puerto Rico">Puerto Rico</button><button data-filter-value="Qatar">Qatar</button><button data-filter-value="Reunion">Reunion</button><button data-filter-value="Romania">Romania</button><button data-filter-value="Russian Federation">Russian Federation</button><button data-filter-value="Rwanda">Rwanda</button><button data-filter-value="Saint Helena">Saint Helena</button><button data-filter-value="Saint Kitts and Nevis">Saint Kitts and Nevis</button><button data-filter-value="Saint Lucia">Saint Lucia</button><button data-filter-value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</button><button data-filter-value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</button><button data-filter-value="Samoa">Samoa</button><button data-filter-value="San Marino">San Marino</button><button data-filter-value="Sao Tome and Principe">Sao Tome and Principe</button><button data-filter-value="Saudi Arabia">Saudi Arabia</button><button data-filter-value="Senegal">Senegal</button><button data-filter-value="Serbia and Montenegro">Serbia and Montenegro</button><button data-filter-value="Seychelles">Seychelles</button><button data-filter-value="Sierra Leone">Sierra Leone</button><button data-filter-value="Singapore">Singapore</button><button data-filter-value="Slovakia">Slovakia</button><button data-filter-value="Slovenia">Slovenia</button><button data-filter-value="Solomon Islands">Solomon Islands</button><button data-filter-value="Somalia">Somalia</button><button data-filter-value="South Africa">South Africa</button><button data-filter-value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</button><button data-filter-value="Spain">Spain</button><button data-filter-value="Sri Lanka">Sri Lanka</button><button data-filter-value="Sudan">Sudan</button><button data-filter-value="Suriname">Suriname</button><button data-filter-value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</button><button data-filter-value="Swaziland">Swaziland</button><button data-filter-value="Sweden">Sweden</button><button data-filter-value="Switzerland">Switzerland</button><button data-filter-value="Syrian Arab Republic">Syrian Arab Republic</button><button data-filter-value="Taiwan, Province of China">Taiwan, Province of China</button><button data-filter-value="Tajikistan">Tajikistan</button><button data-filter-value="Tanzania, United Republic of">Tanzania, United Republic of</button><button data-filter-value="Thailand">Thailand</button><button data-filter-value="Timor-Leste">Timor-Leste</button><button data-filter-value="Togo">Togo</button><button data-filter-value="Tokelau">Tokelau</button><button data-filter-value="Tonga">Tonga</button><button data-filter-value="Trinidad and Tobago">Trinidad and Tobago</button><button data-filter-value="Tunisia">Tunisia</button><button data-filter-value="Turkey">Turkey</button><button data-filter-value="Turkmenistan">Turkmenistan</button><button data-filter-value="Turks and Caicos Islands">Turks and Caicos Islands</button><button data-filter-value="Tuvalu">Tuvalu</button><button data-filter-value="Uganda">Uganda</button><button data-filter-value="Ukraine">Ukraine</button><button data-filter-value="United Arab Emirates">United Arab Emirates</button><button data-filter-value="United Kingdom">United Kingdom</button><button data-filter-value="United States">United States</button><button data-filter-value="United States Minor Outlying Islands">United States Minor Outlying Islands</button><button data-filter-value="Uruguay">Uruguay</button><button data-filter-value="Uzbekistan">Uzbekistan</button><button data-filter-value="Vanuatu">Vanuatu</button><button data-filter-value="Venezuela">Venezuela</button><button data-filter-value="Viet Nam">Viet Nam</button><button data-filter-value="Virgin Islands, British">Virgin Islands, British</button><button data-filter-value="Virgin Islands, U.s.">Virgin Islands, U.s.</button><button data-filter-value="Wallis and Futuna">Wallis and Futuna</button><button data-filter-value="Western Sahara">Western Sahara</button><button data-filter-value="Yemen">Yemen</button><button data-filter-value="Zambia">Zambia</button><button data-filter-value="Zimbabwe">Zimbabwe</button>
<button data-filter-value="*"><!--@Translate(Show_all, "Show all")--></button>
</div>
<!--@If(NumberOfLocations=0)-->
<div class="info"><!--@Translate(No_locations_found, 'No locations found')--></div>
<!--@EndIf-->
</div>