Skip to content

Instantly share code, notes, and snippets.

@pierceray
Forked from craveytrain/geo.js
Created January 30, 2012 21:18
Show Gist options
  • Save pierceray/1706768 to your computer and use it in GitHub Desktop.
Save pierceray/1706768 to your computer and use it in GitHub Desktop.
dataFilter method
$(document).ready(function () {
$.ajaxSetup({
type: "POST",
contentType: "application/json; charset=utf-8",
data:"{}",
dataFilter: function(data) {
var msg = jQuery.parseJSON(data);
return (msg.hasOwnProperty('d')) ? msg.d : msg;
});
var geoRequest = {
"geoRequest": {
"counties": ["Travis"],
"latitude1":0.0,
"latitute2":0.0,
"layers":null,
"longitude1":0.0,
"longitude2":0.0,
"zipCode":null
}
};
var dataToSend = JSON.stringify(geoRequest);
$.ajax({
url: "http://theserver/GeoLocationService/GeoLocationService.svc/find",
data: dataToSend,
success: function(data) {
console.log(data); //keep getting null, but the post is actually returning
}
});
});
{
"d": {
"__type": "GeoResponseCollection:#GeoLocationService.Contracts",
"geoResponses": [
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "4719 S Congress Avenue",
"city": "Austin",
"county": "Travis",
"latitude": 30.214033,
"layer": "Driver License Office (DPS)",
"longitude": -97.769104,
"state": "",
"title": "Travis County Driver License Office",
"zipCode": "78745"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "6121 N Lamar",
"city": "Austin",
"county": "Travis",
"latitude": 30.329384,
"layer": "Driver License Office (DPS)",
"longitude": -97.723998,
"state": "",
"title": "Travis County Driver License Office",
"zipCode": "78752"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "5501 Airport Boulevard",
"city": "Austin",
"county": "Travis",
"latitude": 30.316229,
"layer": "Vehicle Registration Office (TxDMV)",
"longitude": -97.712967,
"state": "",
"title": "Travis County Vehicle Registration Office",
"zipCode": "78751"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "1000 Guadalupe Street",
"city": "Austin",
"county": "Travis",
"latitude": 30.272937,
"layer": "Courthouse",
"longitude": -97.745007,
"state": "",
"title": "Travis County Courthouse",
"zipCode": "78701"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "5501 Airport Boulevard",
"city": "Austin",
"county": "Travis",
"latitude": 30.316229,
"layer": "County Clerk Office",
"longitude": -97.712967,
"state": "",
"title": "Travis County Clerk Office",
"zipCode": "78751"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "6413 Westside Drive",
"city": "Austin",
"county": "Travis",
"latitude": 30.344918,
"layer": "Park",
"longitude": -97.754817,
"state": "",
"title": "Allen Park",
"zipCode": "78731"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "16900 Cherry Lane",
"city": "Lago Vista",
"county": "Travis",
"latitude": 30.402048,
"layer": "Park",
"longitude": -97.955148,
"state": "",
"title": "Arkansas Bend Park",
"zipCode": "78645"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "600 W Carrie Manor Street",
"city": "Manor",
"county": "Travis",
"latitude": 30.339938,
"layer": "Park",
"longitude": -97.562005,
"state": "",
"title": "Ben E. Fisher Park",
"zipCode": "78653"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "7144 Comanche Trail",
"city": "Austin",
"county": "Travis",
"latitude": 30.415564,
"layer": "Park",
"longitude": -97.896913,
"state": "",
"title": "Bob Wentz Park",
"zipCode": "78732"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "13800 Bullick Hollow Road",
"city": "Austin",
"county": "Travis",
"latitude": 30.438743,
"layer": "Park",
"longitude": -97.87307,
"state": "",
"title": "Cypress Creek Park",
"zipCode": "78726"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "3011 Lohman Ford Road",
"city": "Lago Vista",
"county": "Travis",
"latitude": 30.412124,
"layer": "Park",
"longitude": -97.977176,
"state": "",
"title": "Dink Pearson Park",
"zipCode": "78654"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "18701 Blake Manor Road",
"city": "Manor",
"county": "Travis",
"latitude": 30.288479,
"layer": "Park",
"longitude": -97.523053,
"state": "",
"title": "East Metropolitan Park",
"zipCode": "78653"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "3100 Fritz Hughes Park Road",
"city": "Austin",
"county": "Travis",
"latitude": 30.382156,
"layer": "Park",
"longitude": -97.913594,
"state": "",
"title": "Fritz Hughes Park",
"zipCode": "78732"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "100 Water Street",
"city": "Webberville",
"county": "Travis",
"latitude": 30.12632859862,
"layer": "Park",
"longitude": -97.3191512567938,
"state": "",
"title": "Little Webberville Park",
"zipCode": "78621"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "4370 Mansfield Dam Park Road",
"city": "Austin",
"county": "Travis",
"latitude": 30.396535,
"layer": "Park",
"longitude": -97.912977,
"state": "",
"title": "Mansfield Dam Park",
"zipCode": "78723"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "1601 Quinlan Park Road S",
"city": "Austin",
"county": "Travis",
"latitude": 30.328717,
"layer": "Park",
"longitude": -97.926558,
"state": "",
"title": "Mary Quinlan Park",
"zipCode": "78723"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "23610 Hamilton Road",
"city": "Dripping Springs",
"county": "Travis",
"latitude": 30.333529,
"layer": "Park",
"longitude": -98.121923,
"state": "",
"title": "Reimers Ranch Park",
"zipCode": "78620"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "2703 Pecan Street",
"city": "Pflugerville",
"county": "Travis",
"latitude": 30.448834,
"layer": "Park",
"longitude": -97.65635,
"state": "",
"title": "Northeast Metropolitan Park",
"zipCode": "78660"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "2501 Pace Bend Park Road N",
"city": "Spicewood",
"county": "Travis",
"latitude": 30.4379286587452,
"layer": "Park",
"longitude": -98.0422019125205,
"state": "",
"title": "Pace Bend Park",
"zipCode": "78669"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "10001 Burleson Road",
"city": "Austin",
"county": "Travis",
"latitude": 30.1712814886425,
"layer": "Park",
"longitude": -97.6660292439821,
"state": "",
"title": "Richard Moya Park",
"zipCode": "78719"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "9500 Lime Creek Road",
"city": "Leander",
"county": "Travis",
"latitude": 30.465756,
"layer": "Park",
"longitude": -97.905253,
"state": "",
"title": "Sandy Creek Park",
"zipCode": "78641"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "11921 Selma Hughes Park Road",
"city": "Austin",
"county": "Travis",
"latitude": 30.337949,
"layer": "Park",
"longitude": -97.904657,
"state": "",
"title": "Selma Hughes Park",
"zipCode": "78732"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "4511 Highway 71 E",
"city": "Del Valle",
"county": "Travis",
"latitude": 30.186555,
"layer": "Park",
"longitude": -97.607022,
"state": "",
"title": "Southeast Metropolitan Park",
"zipCode": "78617"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "12714 Hughes Park Road",
"city": "Austin",
"county": "Travis",
"latitude": 30.3977978822768,
"layer": "Park",
"longitude": -97.8797800140576,
"state": "",
"title": "Tom Hughes Park",
"zipCode": "78732"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "2305 Park Lane",
"city": "Elgin",
"county": "Travis",
"latitude": 30.216243,
"layer": "Park",
"longitude": -97.493869,
"state": "",
"title": "Webberville Park",
"zipCode": "78621"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "805 N Capital of Texas Highway",
"city": "Austin",
"county": "Travis",
"latitude": 30.31238,
"layer": "Park",
"longitude": -97.826512,
"state": "",
"title": "Wild Basin Wilderness Preserve",
"zipCode": "78746"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "7306 Kirkham Lane",
"city": "Austin",
"county": "Travis",
"latitude": 30.2375035877403,
"layer": "Park",
"longitude": -97.8921494866445,
"state": "",
"title": "Windmill Run Park",
"zipCode": "78736"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "800 Guadalupe Street",
"city": "Austin",
"county": "Travis",
"latitude": 30.271096,
"layer": "Library",
"longitude": -97.745689,
"state": "",
"title": "Austin Public Library",
"zipCode": "78701"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "102 10th Street",
"city": "Pflugerville",
"county": "Travis",
"latitude": 30.443001,
"layer": "Library",
"longitude": -97.627903,
"state": "",
"title": "Pflugerville Community Library",
"zipCode": "78660"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "2300 Lohmans Spur",
"city": "Austin",
"county": "Travis",
"latitude": 30.338053,
"layer": "Library",
"longitude": -97.971184,
"state": "",
"title": "Lake Travis Community Library",
"zipCode": "78734"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "1309 Westbank Drive",
"city": "Austin",
"county": "Travis",
"latitude": 30.274595,
"layer": "Library",
"longitude": -97.810879,
"state": "",
"title": "Westbank Community Library",
"zipCode": "78746"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "18649 FM 1431",
"city": "Jonestown",
"county": "Travis",
"latitude": 30.492924,
"layer": "Library",
"longitude": -97.923271,
"state": "",
"title": "Jonestown Community Library",
"zipCode": "78645"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "5803 Thunderbird",
"city": "Lago Vista",
"county": "Travis",
"latitude": 30.45252,
"layer": "Library",
"longitude": -97.987849,
"state": "",
"title": "Lago Vista Community Library",
"zipCode": "78645"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "15001 Wells Port Drive",
"city": "Austin",
"county": "Travis",
"latitude": 30.446234,
"layer": "Library",
"longitude": -97.67595,
"state": "",
"title": "Wells Branch Community Library",
"zipCode": "78728"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "4000 Galleria Parkway",
"city": "Bee Cave",
"county": "Travis",
"latitude": 30.308792,
"layer": "Library",
"longitude": -97.94024,
"state": "",
"title": "Bee Cave Public Library",
"zipCode": "78738"
},
{
"__type": "GeoResponse:#GeoLocationService.Contracts",
"addressLine1": "13512 FM 812",
"city": "Del Valle",
"county": "Travis",
"latitude": 30.124285,
"layer": "Library",
"longitude": -97.638336,
"state": "",
"title": "East Travis Gateway Library",
"zipCode": "78617"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment