public JsonResult GetTrackFeatures(Map map, GeoCollection <object> args) { string featuresInJson = string.Empty; if (map != null) { // convert wkt to thinkgeo features Feature[] trackedFeatrues = args.Select((t) => { return(new Feature(t.ToString())); }).OfType <Feature>().ToArray(); // add those features into edit overlay map.EditOverlay.Features.Clear(); foreach (Feature item in trackedFeatrues) { map.EditOverlay.Features.Add(item); } // restore other query conditions from session. Collection <EarthquakeQueryConfiguration> queryConfigurations = new Collection <EarthquakeQueryConfiguration>(); if (Session["QueryConfiguration"] != null) { queryConfigurations = Session["QueryConfiguration"] as Collection <EarthquakeQueryConfiguration>; } Collection <Feature> selectedFeatures = FilterEarthquakePoints(map, queryConfigurations); featuresInJson = InternalHelper.ConvertFeaturesToJson(selectedFeatures); } return(Json(new { features = featuresInJson })); }
public static string GenerateLegendItemName(GeoCollection <LegendItemViewModel> legendItems) { return(GenerateOrderedNewName(legendItems.Select(li => li.Text), legendItemNamePattern, "Legend Item")); }