[mapguide-users] mapguide-rest feedback

GordonL gordon.luckett at arrowgeomatics.com
Sun Jan 25 18:30:38 PST 2015


I found a jQuery work-around for sorting the json...

$("#address").autocomplete({ 
    delay: 0, 
    source: function( request, response ) { 
      $.ajax({ 
                  url:
"/mapserver2015/rest/library/Samples/Sheboygan/Layers/Parcels.LayerDefinition/features.geojson", 
          dataType: "json", 
          data: { 
                        filter: "RBILAD LIKE '" + request.term   + "%'" 
          },

        success: function(data) {
									*data.features = $(data.features).sort(sortJsonAddress);*
          }


I create a function called sortJsonAddress that sorted by a field in the
json...


*function sortJsonAddress(a,b)
	{
		return a.properties.RBILAD > b.properties.RBILAD ? 1 : -1;
	};*

Surprisingly it works well, even with 1000s of records.





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/mapguide-rest-feedback-tp5168657p5183663.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list