Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this function is called on map click event | |
showEntities: function(latLng) { | |
try { | |
cwns.map.removeLayer(cwns.current.selectedGeoJson); | |
cwns.current.countyGroupLayer.clearLayers(); | |
cwns.current.congDistGroupLayer.clearLayers(); | |
cwns.current.stateGroupLayer.clearLayers(); | |
cwns.mapMarker.setLatLng(latLng); | |
cwns.map.addLayer(cwns.mapMarker); | |
cwns.cwnsDynamicLayer.identify() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>One Minute Map</title> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="https://mapzen.com/js/mapzen.css"> | |
<script src="https://mapzen.com/js/mapzen.min.js"></script> | |
<style> | |
#map { | |
height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"Country":"Falkland Islands","populationIoName":"NotFound","iso2Code":"FK"},{"Country":"French Guiana","populationIoName":"French Guiana","iso2Code":"GF"},{"Country":"Guyana","populationIoName":"Guyana","iso2Code":"GY"},{"Country":"Cyprus","populationIoName":"Cyprus","iso2Code":"CY"},{"Country":"Pitcairn","populationIoName":"NotFound","iso2Code":"PN"},{"Country":"South Georgia","populationIoName":"NotFound","iso2Code":"GS"},{"Country":"Saint Helena","populationIoName":"NotFound","iso2Code":"SH"},{"Country":"Egypt","populationIoName":"Arab Rep of Egypt","iso2Code":"EG"},{"Country":"Suriname","populationIoName":"Suriname","iso2Code":"SR"},{"Country":"Georgia","populationIoName":"Georgia","iso2Code":"GE"},{"Country":"Greece","populationIoName":"Greece","iso2Code":"GR"},{"Country":"Trinidad and Tobago","populationIoName":"Trinidad and Tobago","iso2Code":"TT"},{"Country":"Lebanon","populationIoName":"Lebanon","iso2Code":"LB"},{"Country":"Syria","populationIoName":"Syrian Arab Rep","iso2Code":"SY"},{"Country":"Ve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.typeahead { | |
background-color: #FFFFFF; | |
} | |
.tt-dropdown-menu { | |
background-color: #FFFFFF; | |
border: 1px solid rgba(0, 0, 0, 0.2); | |
border-radius: 4px 4px 4px 4px; | |
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); | |
margin-top: 4px; | |
padding: 4px 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.on("typeahead:selected", function (obj, datum) { | |
// what happens when a user selects\clicks a suggestion | |
// we get the datum that contains the properties we defined when we setup the engine via the filter function | |
map.graphics.clear(); | |
switch(datum.source) { | |
case "esri-geocoder": | |
var url = config.arcgisGeocodingBaseUrl + "find?" + | |
"magicKey=" + datum.magicKey + "&text=" + datum.name + | |
"&outFields=Addr_type&f=json"; | |
// https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find.htm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#searchInput").typeahead({ | |
// how many characters does the user type before suggestions start firing | |
minLength: 3, | |
highlight: true, | |
hint: false | |
}, { | |
name: "camp", | |
displayKey: "name", | |
source: campBH.ttAdapter(), | |
// what the header looks like for this source in the suggestions drop down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
, { | |
name: "camp", | |
displayKey: "name", | |
source: campBH.ttAdapter(), | |
// what the header looks like for this source in the suggestions drop down | |
templates: { | |
header: "<h1 class='typeahead-header'><span class='icon icon-camp'></span> Campgrounds</h1>" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#searchInput").typeahead({ | |
minLength: 3, | |
highlight: true, | |
hint: false | |
}, | |
… |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build the esri geocoder bloodhound engine | |
var esriBH = new Bloodhound({ | |
name: "esri-geocoder", | |
datumTokenizer: function (d) { | |
return Bloodhound.tokenizers.whitespace(d.name); | |
}, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
remote: { | |
//https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm | |
// use the searchExtent parameter to limit the results to roughly washington state |
NewerOlder