Water Sports

Amelia Earhart Park – Miami-Dade County

<![CDATA[window.Handlebars || document.write('//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.js <!–[if lt IE 7]>

You are using an outdated browser. Upgrade your browser today or install Google Chrome Frame to better experience this site.

<![endif]-->        <!-- Add your site or application content here -->    <a href="//serverapi.arcgisonline.com/jsapi/arcgis/3.3/">//serverapi.arcgisonline.com/jsapi/arcgis/3.3/</a><![CDATA[window.jQuery || document.write(&#039;<a href="http://scripts/vendor/jquery.min.js">http://scripts/vendor/jquery.min.js</a><![CDATA[          /********************************************************* ********* GIS Code for Park finder *********************** *********************************************************/             dojo.require("esri.map");             dojo.require(&#039;dojo.io.script&#039;);               function useCurrentLocation() {                  document.getElementById("error").innerHTML = "<img src='img/preload-gear.gif' height='40' width='40' />]]>";


             navigator.geolocation.getCurrentPosition(show_map, handle_error, { enableHighAccuracy: true });

         };

         function handle_error(error) {

             if (error.code == 1) {

                 document.getElementById("error").innerHTML = "If you would like to use your current location, you must allow us to access your current location.";
                 return false;
             }

         };


         function plotPoint(location) {


         }

         function cbfunc(result) {

             if (result != null) {
                 //esriConfig.defaults.io.proxyUrl = "//devnet.miamidade.gov/proxy.ashx";
                 esriConfig.defaults.io.proxyUrl = "/parks/proxy.ashx";
                 //esriConfig.defaults.io.proxyUrl = "//localhost:63418/proxy.ashx";
                 esriConfig.defaults.io.alwaysUseProxy = false;

                 qt = new esri.tasks.QueryTask("//gisms.miamidade.gov/ArcGIS/rest/services/LocalGov/MD_LocalGovernment/MapServer/9");
                 query = new esri.tasks.Query();
                 query.where = "1=1";
                 query.returnGeometry = true;
                 query.outFields = ["NAME", ""];


                 var mapPoint = new esri.geometry.Point(result.query.results.ArrayOfDouble.double[0], result.query.results.ArrayOfDouble.double[1], new esri.SpatialReference({ wkid: 2236 }));

                 var distance = dojo.byId("distance").value * 5280;

                 bufferHelper(mapPoint, distance, bufferResult);
             }
             else {
                 document.getElementById("error").innerHTML = "The system is currently having issues, please try again later.";
             }

         };

         function show_map(position) {

             var pointsLayer = new esri.layers.GraphicsLayer();

             //map.addLayer(pointsLayer);

             var point = new esri.geometry.Point(position.coords.longitude, position.coords.latitude, new esri.SpatialReference({ wkid: 4326 }));

             pointsLayer.add(
                 new esri.Graphic(
                 point,
                 new esri.symbol.SimpleMarkerSymbol().setColor(
                     new dojo.Color([255, 0, 0, 0.5]))
                 )
             );
             //map.centerAndZoom(point, 11);



             dojo.io.script.get({
                 //GIS services returns xml, we need to convert it to jsonp
                 url: "//query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D'http%3A%2F%2Fgisws.miamidade.gov%2FGISXYServices%2FXYLatLongConversions.asmx%2FgetXYfromLatLongDec%3FLNG%3D" + position.coords.longitude + "%26LAT%3D" + position.coords.latitude + "'&format=json&diagnostics=true&callback=cbfunc",
                 output: "pjson"

             });


         };


         function getParksNearby() {


             $(".loader").css('display', 'block');

             if ($("#myAddress").val() == "") {

                 document.getElementById("error").innerHTML = "Please enter an address.";
                 $("#error").css({'display': 'block'});
                 return false;

             }

             esriConfig.defaults.io.proxyUrl = "/parks/proxy.ashx";
             //esriConfig.defaults.io.proxyUrl = "//localhost:63418/proxy.ashx";
             esriConfig.defaults.io.alwaysUseProxy = false;

             //qt = new esri.tasks.QueryTask("//gisms.miamidade.gov/ArcGIS/rest/services/LocalGov/MD_LocalGovernment/MapServer/9");
             qt = new esri.tasks.QueryTask("//gisms.miamidade.gov/ArcGIS/rest/services/NAD83/CultureAndRecreation_Park/MapServer/0");
             query = new esri.tasks.Query();
             query.where = "1=1";
             query.returnGeometry = true;
             query.outFields = ["NAME", "POINT_X", "POINT_Y"];
             dojo.io.script.get({
                 // url: "//gisms.miamidade.gov/ArcGIS/rest/services/Andrew_Geocoder/GeocodeServer/findAddressCandidates?",
                 url: "//gisws.miamidade.gov/ArcGIS/rest/services/MDC_Locators/GeoAddress_75/GeocodeServer/findAddressCandidates",


                 content: { Street: dojo.byId("myAddress").value, f: "pjson" },

                 callbackParamName: "callback"
             }).then(function (data) {

                 if (data.candidates.length == 0) {
                     document.getElementById("error").innerHTML = "No parks were found, please check the address and try again.";
                     return false;
                 }

                 return data.candidates[0].location;
             }).then(function (location) {

                 //plotPoint(location);

                 localStorage.setItem('location', JSON.stringify(location));

                 var distance = dojo.byId("distance").value * 5280;
                 var mapPoint = new esri.geometry.Point(location.x, location.y, new esri.SpatialReference({ wkid: 2236 }));

                 localStorage.setItem("address", dojo.byId("myAddress").value);

                 bufferHelper(mapPoint, distance, bufferResult);
             });

         }
         //function to buffer geometries
         function bufferHelper(geometry, distance, onResult) {
             var params = new esri.tasks.BufferParameters();
             params.geometries = [geometry];
             params.distances = [distance];
             params.unit = esri.tasks.GeometryService.UNIT_FOOT;
             params.outSpatialReference = new esri.SpatialReference({ wkid: 2236 });

             var geometryService = new esri.tasks.GeometryService("//gisweb.miamidade.gov/ArcGIS/rest/services/Utilities/Geometry/GeometryServer");

             geometryService.buffer(params, onResult, onBufferFault);
         }

function bufferResult(data) {
showBuffer(data);

 query.where = "1=1";

 query.geometry = data[0];
 qt.execute(query, showResults);

 var parksArray = [];

};

function showResults(fset){

if (!fset || fset.features.length == 0) {

  $("#error").html("No results found.");
  $("#error").css({'display': 'block'});
   return false;

}

var parksArray = [];

dojo.forEach(fset.features, function (feature, i) {

   if(feature.attributes.NAME == "NAME"){

     $("#error").html("GIS service currently unavailable, please try again later.");
     $("#error").css({'display': 'block'});
     return false;
   }

   if (feature.attributes.NAME.indexOf('Park') > -1) {

       parksArray.push({
           "name": feature.attributes.NAME,
           "x": feature.attributes.POINT_X,
           "y" : feature.attributes.POINT_Y
       });


   };

});

//getParksFromServer(parksArray);

var filteredList = [];

$.each(parksArray, function(k, v){

   $.each(ListOfParks, function(key, val){

       if(v.name.replace("&", "and").trim() == val.name.trim()){
           filteredList.push(val);
       }
   })

});

if(filteredList.length == 0){
$(“#error”).html(“No results found.”);
$(“#error”).css({“display”: “block”});
return false;

} else {

   if(localStorage.getItem("parksSearchResults")){
       localStorage.setItem("parksSearchResults",  "");
   }

   localStorage.setItem("parksSearchResults", JSON.stringify(filteredList));

}

//if(docCookies.hasItem(“parksSearchResults”)){
if(localStorage.getItem(“parksSearchResults”)){
window.location = “search-results.asp?type=park-finder”;
}

};

function getParksFromServer(arrParks) {

 this.arrParks = arrParks;


 var collection = [];

 $.ajax({
     url: "//www.miamidade.gov/CAO/app/getParks.ashx?method=getParks&parksList = " + JSON.stringify(arrParks),
     // url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?method=getParks&parksList = " + JSON.stringify(arrParks),
     type: "POST",
     contentType: 'application/json; charset=utf-8',
     //data: JSON.stringify(arrParks),
     success: function (parksFromServer) {
     //complete: function (parksFromServer) {


         if(parksFromServer){
             var data = JSON.parse(parksFromServer);

             _.each(data, function(datum){

                 var park = new Park(datum);

             });


             $("#results").append(park);
             //}); 
         } else {

             if(parksFromServer.length === 0){

             $("#results").append(park);
         }
     }
     },
     complete: function(data){
         //console.log('list: ', data);
     } 
 });

};

         function onBufferFault(err) {
             //handle error
             if (console) {
                 console.log(err);
             }

             $("#error").html("Please enter a valid adress.");
             $("#error").css({'display': 'block'});
         };


         function showBuffer(geometries) {
             var symbol = new esri.symbol.SimpleFillSymbol(
                     esri.symbol.SimpleFillSymbol.STYLE_SOLID,
                     new esri.symbol.SimpleLineSymbol(
                             esri.symbol.SimpleLineSymbol.STYLE_SOLID,
                             new dojo.Color([0, 0, 255, 0.65]), 2
                     ),
                     new dojo.Color([0, 0, 255, 0.35])
             );

             dojo.forEach(geometries, function (geometry) {
                 //var graphic = new esri.Graphic(geometry, symbol);
                 //map.graphics.add(graphic);

             });

         };

/*********************************************************
********* End GIS Code for Park finder ***********************
*********************************************************/

function filterParks(filterType, filter) {

 this.filterType = filterType;
 this.filter = filter;

 var promise = $.ajax({
     // url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     url: "//www.miamidade.gov/cao/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     type: "GET",
     dataType: "jsonp"});

     promise.done(function (filteredParks) {

         filteredParks.push($.parseJSON('{ "filterName": "' + filter + '"}'));
         filteredParks.sort(function(a,b) {return (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0);} );

         var theTemplate = Handlebars.compile($("#parks-template").html());
         $(".resultsList").html(theTemplate(filteredParks))

     });

     promise.fail(function(){

         var filteredParks = [$.parseJSON('{ "filterName": "No results found."}')];
         var theTemplate = Handlebars.compile($("#parks-template").html());
         $(".resultsList").html(theTemplate(filteredParks))

     })

};

function filterParksByActivity(filterType, filter) {

 this.filterType = filterType;
 this.filter = filter;

 var promise = $.ajax({
     url: "//www.miamidade.gov/CAO/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     // url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     type: "GET",
     dataType: "jsonp"});

     promise.done(function (filteredParks) {

         localStorage.setItem('filter', filter);

     filteredParks.sort(function(a,b) {return (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0);} );


     if(localStorage.getItem("parksSearchResults")){
       localStorage.setItem("parksSearchResults",  "");
     }

     localStorage.setItem("parksSearchResults", JSON.stringify(filteredParks));

     if(localStorage.getItem("address")){
       localStorage.setItem("address", "");
     }


     if(localStorage.getItem("parksSearchResults")){
       window.location = "search-results.asp?type=activities";
     }

     });

};

function getActivitiesFromServer(){

 $.ajax({
     // url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?method=activities",
     url: "//www.miamidade.gov/CAO/app/getParks.ashx?method=activities",
     type: "GET",
     dataType: 'jsonp'
 }).pipe(function(activities){


 if(activities.error){
   return $.Deferred().reject(activities);
 }

    var theTemplate = Handlebars.compile($("#activities-template").html());
     $("#actSportsDrop").html(theTemplate(activities.GetFacilities))


      //Attaching event listener after AJAX call.
     $(".actListen").on('change', function (e) {
         var value = $(this).children('option').filter(":selected").val();


         if($(this).children("option").filter(":selected").text() != "Please select one")
         {
            filterParksByActivity($(this).attr('id'), $(this).children("option").filter(":selected").text());
         }
         else
         {
             $("#error").text("Please select a value from the dropdown.");
             $("#error").css({"display": "block"});
         }

     });
 },

   function(facilities){
     $("#error").html('This record could not be found.');
     $("#error").css({"display": "block"});
     return $.Deferred().reject({error: true});      
   }


 );

}

function filterParksByAmenity(filterType, filter) {

 this.filterType = filterType;
 this.filter = filter;

 var promise = $.ajax({
     url: "//www.miamidade.gov/CAO/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     // url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     type: "GET",
     dataType: "jsonp"});

     promise.done(function (filteredParks) {

         //filteredParks.unshift($.parseJSON('{ "filterName": "' + filter + '"}'));

   localStorage.setItem('filter', filter);

     filteredParks.sort(function(a,b) {return (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0);} );

   if(localStorage.getItem("parksSearchResults")){
     localStorage.setItem("parksSearchResults",  "");
   }

   localStorage.setItem("parksSearchResults", JSON.stringify(filteredParks));


   if(localStorage.getItem('address')){
     localStorage.setItem('address', '');
   }

   if(localStorage.getItem("parksSearchResults")){
     window.location = "search-results.asp?type=amenities";
   }

   /*
     var theTemplate = Handlebars.compile($("#parks-template").html());
         $(".resultsList").html(theTemplate(filteredParks))
         */
     });

     promise.fail(function(){

       var filteredParks = [$.parseJSON('{ "filterName": "No results found."}')];
       var theTemplate = Handlebars.compile($("#parks-template").html());
       $(".resultsList").html(theTemplate(filteredParks))

     })

};

function getAmenitiesFromServer(){

 $.ajax({
     url: "//www.miamidade.gov/CAO/app/getParks.ashx?method=facilities",
     // url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?method=facilities",
     type: "GET",
     dataType: 'jsonp'
 }).pipe(function(amenities){


   if(amenities.error){
     return $.Deferred().reject(amenities);
   }


    var theTemplate = Handlebars.compile($("#amenities-template").html());
     $("#amenityDrop").html(theTemplate(amenities.GetFacilities))


      //Attaching event listener after AJAX call.
                 $(".amenListen").on('change', function (e) {
                     var value = $(this).children('option').filter(":selected").val();


                     if($(this).children("option").filter(":selected").text()    != "Please select one"){
                        filterParksByAmenity($(this).attr('id'), $(this).children("option").filter(":selected").text());
                     }
                      else
                     {
                         $("#error").text("Please select a value from the dropdown.");
                         $("#error").css({"display": "block"});
                     }

                 });
 },

   function(facilities){
     $("#error").html('This record could not be found.');
     $("#error").css({"display": "block"});
     return $.Deferred().reject({error: true});      
   }


 );

}

function getParkNamesFromServer(){

 $.ajax({
     // url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?method=getParks",
     url: "//www.miamidade.gov/cao/app/getParks.ashx?method=getParks",
     type: "GET",
     dataType: 'jsonp'
 }).pipe(function(parks){


     if(parks.error){
         return $.Deferred().reject(parks);
     }

     ListOfParks = parks.slice();

     var theTemplate = Handlebars.compile($("#parkNames-template").html());



     $.each(parks, function(key, val){

         if(val.filename && val.filename.indexOf('acadia') >= 0){
             val.filename = "acadia.asp";
         }
     });


     $("#finderDrop").html(theTemplate(parks));

      //Attaching event listener after AJAX call.
     $(".parksListen").on('change', function (e) {
         var value = $(this).children('option').filter(":selected").val();


         if($(this).attr('id') == "parkName"){

           window.open(value,"_parent");
         }
     });
 },

     function(parks){
                     console.log('error 2');
         return $.Deferred().reject({error: true});      
     }


 );

}

function getProgramsFromServer(){

 $.ajax({
     //url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?method=programs",
       url: "//www.miamidade.gov/CAO/app/getParks.ashx?method=programs",
     type: "GET",
     dataType: 'jsonp'
 }).pipe(function(programs){


 if(programs.error){
   return $.Deferred().reject(programs);
 }

    var theTemplate = Handlebars.compile($("#programs-template").html());
     $("#progDrop").html(theTemplate(programs.GetFacilities))


      //Attaching event listener after AJAX call.
     $(".progListen").on('change', function (e) {
         var value = $(this).children('option').filter(":selected").val();


         if($(this).children("option").filter(":selected").text() != "Please select one")
         {
            filterParksByProgram($(this).attr('id'), $(this).children("option").filter(":selected").text());
         }
         else
         {
             $("#error").text("Please select a value from the dropdown.");
             $("#error").css({"display": "block"});
         }

     });
 },

   function(facilities){
     $("#error").html('This record could not be found.');
     $("#error").css({"display": "block"});
     return $.Deferred().reject({error: true});      
   }


 );

}

function filterParksByProgram(filterType, filter) {

 this.filterType = filterType;
 this.filter = filter;

 var promise = $.ajax({
     url: "//www.miamidade.gov/CAO/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     //url: "//devnet.miamidade.gov/CAO/app/getParks.ashx?filterType=" + filterType + "&filter=" + filter + "&callback=?",
     type: "GET",
     dataType: "jsonp"});

     promise.done(function (filteredParks) {

   localStorage.setItem('filter', filter);

     filteredParks.sort(function(a,b) {return (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0);} );

   if(localStorage.getItem("parksSearchResults")){
     localStorage.setItem("parksSearchResults",  "");
   }

   localStorage.setItem("parksSearchResults", JSON.stringify(filteredParks));


   if(localStorage.getItem('address')){
     localStorage.setItem('address', '');
   }

   if(localStorage.getItem("parksSearchResults")){
     window.location = "search-results.asp?type=programs";
   }

     });

     promise.fail(function(){

       var filteredParks = [$.parseJSON('{ "filterName": "No results found."}')];
       var theTemplate = Handlebars.compile($("#parks-template").html());
       $(".resultsList").html(theTemplate(filteredParks))

     })

};

   <![CDATA[            By Name: <br />                Please select a park                {{#each this}}                 {{name}}                {{/each}}                 ]]>

Source

WaterSports
The water has always been a favorite place for outdoor recreation. Paddling a canoe along a rambling creek, jumping the wake behind a fast boat, or snorkeling among coral reefs, are just a few of the many ways you can have fun in the water. The one thing that these and every other form of water recreation have in common is that they can all be made more enjoyable with our water sports equipment. We have all types of inflatables from balls to boats, every kind of towable equipment from tubes to water skis, canoes and kayaks and the carriers and racks to get them to the water, snorkeling gear, pools, waterproof action cameras to record your aquatic adventures.
http://watersports.floridaboating.com