/// <summary> /// /// </summary> /// <param name="geom"></param> /// <param name="bounds"></param> public TreeLoader2D(PagedGeometry geom, TBounds bounds) { //Calculate grid size mGeom = geom; mPageSize = mGeom.PageSize; //Reset height function mHeightFunction = null; mHeightFunctionUserData = null; //Make sure the bounds are aligned with PagedGeometry's grid, so the TreeLoader's grid tiles will have a 1:1 relationship mActualBounds = bounds; mGridBounds = bounds; mGridBounds.Left = (float)(mPageSize * System.Math.Floor((mGridBounds.Left - mGeom.Bounds.Left) / mPageSize) + mGeom.Bounds.Left); mGridBounds.Top = (float)(mPageSize * System.Math.Floor((mGridBounds.Top - mGeom.Bounds.Top) / mPageSize) + mGeom.Bounds.Top); mGridBounds.Right = (float)(mPageSize * System.Math.Ceiling((mGridBounds.Right - mGeom.Bounds.Left) / mPageSize) + mGeom.Bounds.Left); mGridBounds.Bottom = (float)(mPageSize * System.Math.Ceiling((mGridBounds.Bottom - mGeom.Bounds.Top) / mPageSize) + mGeom.Bounds.Top); //Calculate page grid size mPageGridX = (int)(System.Math.Ceiling(mGridBounds.Width / mPageSize) + 1); mPageGridZ = (int)(System.Math.Ceiling(mGridBounds.Height / mPageSize) + 1); //Reset color map mColorMap = null; mColorMapFilter = MapFilter.None; //Default scale range mMaximumScale = 2.0f; mMinimumScale = 0.0f; }
private void updateJavaScriptMap(WasteTransferTimeSeriesFilter filter) { MapFilter mapfilter = QueryLayer.WasteTransferTrend.GetMapJavascriptFilter(filter); MapJavaScriptUtils.UpdateJavaScriptMap(mapfilter, Page); }
// update flash map private void updateFlashMap(string layerID) { MapFilter mapFilterSmall; MapFilter mapFilterExpanded; String header; if (String.IsNullOrEmpty(layerID)) //clear map { mapFilterSmall = new MapFilter(); mapFilterSmall.Layers = layerID; mapFilterExpanded = mapFilterSmall; header = ""; } else { DiffuseSources.Map map = DiffuseSources.GetMap(layerID); mapFilterSmall = map.MapFilterSmall; mapFilterExpanded = map.MapFilterExpanded; header = map.GetTitleFull(); } MapUtils.UpdateDiffuseMap(MAPID, Page, Page.ClientID, mapFilterSmall, "", Request.ApplicationPath); // ((MasterSearchPage)this.Master).UpdateExpandedScript(mapFilterExpanded, header); }
/// <summary> /// update flash map /// </summary> /* private void updateFlashMap(PollutantReleaseSearchFilter filter) * { * MapFilter mapfilter = QueryLayer.PollutantReleases.GetMapFilter(filter); * string header = MapPrintDetails.Build(SheetHeaderBuilder.GetPollutantReleaseSearchHeader(filter, false)); * MapUtils.UpdateSmallMap(MasterSearchPage.MAPID, this, this.ClientID, mapfilter, header, Request.ApplicationPath); * ((MasterSearchPage)this.Master).UpdateExpandedScript(mapfilter, header); * }*/ private void updateJavaScriptMap(PollutantReleaseSearchFilter filter) { MapFilter mapfilter = QueryLayer.PollutantReleases.GetMapJavascriptFilter(filter); MapJavaScriptUtils.UpdateJavaScriptMap(mapfilter, Page); }
public static MapFilter GetMapDetailsJavascriptFilter(string ReportID) { // create sql and sectors to map MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = "FacilityReportID = " + ReportID; return(mapFilter); }
private void updateFlashMap(FacilitySearchFilter filter) { // update flash map MapFilter mapfilter = QueryLayer.Facility.GetMapFilter(filter); string header = MapPrintDetails.Build(SheetHeaderBuilder.GetFacilitySearchHeader(filter, false)); MapUtils.UpdateSmallMap(MasterSearchPageEPER.MAPID, Page, this.UniqueID, mapfilter, header, Request.ApplicationPath); ((MasterSearchPageEPER)this.Master).UpdateExpandedScript(mapfilter, header); }
public static void UpdateJavaScriptMap(MapFilter mapfilter, Control control) { const string quote = "\""; string layerName = quote + "EprtrFacilities_Dyna_WGS84_1098" + quote; string serviceName = quote + "http://discomap.eea.europa.eu/ArcGIS/rest/services/Air/EprtrFacilities_Dyna_WGS84/MapServer/0" + quote; string queryFunction = "filterFacility(" + layerName + "," + serviceName + "," + quote + mapfilter.SqlWhere + quote + ")"; ScriptManager.RegisterStartupScript(control, control.GetType(), "funcionInicial", queryFunction, true); }
public FrmMapFilterSettings(MapFilter m) { _m = m; InitializeComponent(); foreach (string filter in MapFilterConfig.Default.TileFilters) listTileFilters.Items.Add(filter); foreach (string filter in MapFilterConfig.Default.ObjectFilters) listObjectFilters.Items.Add(filter); chkEnabled.Checked = MapFilterConfig.Default.Enabled; }
private void OnClickPlanet() { MapFilter mask = RTCore.Instance.Renderer.Filter; if ((mask & MapFilter.Planet) == MapFilter.Planet) { RTCore.Instance.Renderer.Filter &= ~MapFilter.Planet; return; } RTCore.Instance.Renderer.Filter |= MapFilter.Planet; }
private void OnClickCompath() { MapFilter mask = RTCore.Instance.Renderer.Filter; if ((mask & MapFilter.Path) == MapFilter.Path) { RTCore.Instance.Renderer.Filter &= ~MapFilter.Path; return; } RTCore.Instance.Renderer.Filter |= MapFilter.Path; }
private void OnClickReach() { MapFilter mask = RTCore.Instance.Renderer.Filter; if ((mask & MapFilter.Cone) == MapFilter.Cone) { RTCore.Instance.Renderer.Filter &= ~MapFilter.Cone; return; } RTCore.Instance.Renderer.Filter |= MapFilter.Cone; }
public ActionResult LoadGeolocations(MapFilter filter) { var viewmodel = _facade.GetMapDetailsViewModel(filter); if (viewmodel != null) { return(PartialView("_MapEventsPartial", viewmodel)); } return(Content("")); }
public static MapFilter GetMapJavascriptFilter(FacilitySearchFilter filter) { Expression <Func <FACILITYSEARCH_ALL, bool> > lambda = getLambdaExpression(filter); // create sql and sectors to map MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQLJavascript(lambda, lambda.Parameters[0]); mapFilter.SqlWhere = "FacilityReportID IN (select FacilityReportID from FACILITYSEARCH_ALL where " + mapFilter.SqlWhere + ")"; return(mapFilter); }
/// <summary> /// returns the MapFilter (sql and layers) corresponding to the filter. /// </summary> public static MapFilter GetMapFilter(FacilitySearchFilter filter) { Expression <Func <FACILITYSEARCH_ALL, bool> > lambda = getLambdaExpression(filter); // create sql and sectors to map MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQL(lambda, lambda.Parameters[0]); mapFilter.SetLayers(filter.ActivityFilter); return(mapFilter); }
public void It_Should_Do_The_Same_As_Lookup_When_Dictionary() { // Arrange var dict = DataFixtures.CreateDictionary(1, "Value 1 A", "Value 1 B"); var field = "field1"; var mapFilter = new MapFilter(LiquidString.Create(field)); // Act var result = mapFilter.Apply(new TemplateContext(), dict).SuccessValue <LiquidString>(); // Assert Assert.That(result, Is.EquivalentTo("Value 1 A")); }
/// <summary> /// Update Expand script /// </summary> public void UpdateExpandedScript(MapFilter mapfilter, string header) { string searchPage = (ViewState[SEARCHPAGE] == null) ? String.Empty : ViewState[SEARCHPAGE].ToString(); ViewState[EXPAND_QUERY] = mapfilter.SqlWhere; ViewState[EXPAND_SECTOR] = mapfilter.Layers; ViewState[EXPAND_VISIBLE] = mapfilter.VisibleLayers; ViewState[EXPAND_HEAD] = header; // Safety storing of sql // Store the current sql in cookie. Only used as fallback if ViewState fails to store values CookieStorage.SaveExpandMap(Response, mapfilter.SqlWhere, mapfilter.Layers, header, mapfilter.VisibleLayers); }
public static MapFilter GetMapJavascriptFilter(IndustrialActivitySearchFilter filter) { ParameterExpression param = Expression.Parameter(typeof(FACILITYSEARCH_MAINACTIVITY), "s"); Expression exp = LinqExpressionBuilder.GetLinqExpressionIndustrialActivitySearch(filter, param); Expression <Func <FACILITYSEARCH_MAINACTIVITY, bool> > lambda = Expression.Lambda <Func <FACILITYSEARCH_MAINACTIVITY, bool> >(exp, param); // create sql and sectors to map MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQL(exp, param); return(mapFilter); }
public static MapFilter GetMapJavascriptFilter(PollutantTransfersSearchFilter filter) { ParameterExpression param = Expression.Parameter(typeof(POLLUTANTTRANSFER), "s"); Expression exp = LinqExpressionBuilder.GetLinqExpressionPollutantTransfers(filter, param); Expression <Func <POLLUTANTTRANSFER, bool> > lambda = Expression.Lambda <Func <POLLUTANTTRANSFER, bool> >(exp, param); // create sql and sectors to map MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQLJavascript(exp, param); mapFilter.SqlWhere = "FacilityReportID IN (select FacilityReportID from dbo.POLLUTANTTRANSFER where " + mapFilter.SqlWhere + ")"; return(mapFilter); }
/// <summary> /// update flash map /// </summary> public static void UpdateSmallMap(string mapid, Control control, string clientID, MapFilter mapfilter, string header, string applicationPath) { MapFilter clone = mapfilter.Clone() as MapFilter; //always include all layers on small map, since there is only one layer. clone.Layers = ActivityFilter.AllSectorsID.ToString(); if (!String.IsNullOrEmpty(mapfilter.SqlWhere)) { //header is not needed for small map string script = getScriptInitializeMap(mapid, clone, "", false); ScriptManager.RegisterClientScriptBlock(control, control.GetType(), mapid + clientID, script, true); } }
// ---------------------------------------------------------------------------------- // Map filters // ---------------------------------------------------------------------------------- #region Map /// <summary> /// returns the MapFilter (sql and layers) corresponding to the filter. /// </summary> public static MapFilter GetMapFilter(PollutantTransfersSearchFilter filter) { ParameterExpression param = Expression.Parameter(typeof(POLLUTANTTRANSFER), "s"); Expression exp = LinqExpressionBuilder.GetLinqExpressionPollutantTransfers(filter, param); Expression <Func <POLLUTANTTRANSFER, bool> > lambda = Expression.Lambda <Func <POLLUTANTTRANSFER, bool> >(exp, param); // create sql and sectors to map MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQL(exp, param); mapFilter.SetLayers(filter.ActivityFilter); return(mapFilter); }
/// <summary> /// returns the MapFilter (sql and layers) corresponding to the filter. /// </summary> public static MapFilter GetMapFilter(IndustrialActivitySearchFilter filter) { DataClassesFacilityDataContext db = getFacilityDataContext(); ParameterExpression param = Expression.Parameter(typeof(FACILITYSEARCH_MAINACTIVITY), "s"); Expression exp = LinqExpressionBuilder.GetLinqExpressionIndustrialActivitySearch(filter, param); Expression <Func <FACILITYSEARCH_MAINACTIVITY, bool> > lambda = Expression.Lambda <Func <FACILITYSEARCH_MAINACTIVITY, bool> >(exp, param); // create sql and sectors to map MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQL(exp, param); mapFilter.SetLayers(filter.ActivityFilter); return(mapFilter); }
// ---------------------------------------------------------------------------------- // Map filters // ---------------------------------------------------------------------------------- #region Map /// <summary> /// returns the MapFilter (sql and layers) corresponding to the filter. /// </summary> public static MapFilter GetMapFilter(PollutantTransferTimeSeriesFilter filter) { //parameter must be "p" to match map config file ParameterExpression param = Expression.Parameter(typeof(POLLUTANTTRANSFER), "p"); Expression exp = LinqExpressionBuilder.GetLinqExpressionPollutantTransfers(filter, param); Expression <Func <POLLUTANTTRANSFER, bool> > lambda = Expression.Lambda <Func <POLLUTANTTRANSFER, bool> >(exp, param); // create sql and sectors to map. Do not remove parameter prefix. MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQL(lambda.Body, null); mapFilter.SetLayers(filter.ActivityFilter); return(mapFilter); }
public static MapFilter GetMapJavascriptFilter(WasteTransferTimeSeriesFilter filter) { //parameter must be "p" to match map config file ParameterExpression param = Expression.Parameter(typeof(WASTETRANSFER), "p"); Expression exp = LinqExpressionBuilder.GetLinqExpressionWasteTransfer(filter, param, false); Expression <Func <WASTETRANSFER, bool> > lambda = Expression.Lambda <Func <WASTETRANSFER, bool> >(exp, param); // create sql and sectors to map. Do not remove parameter prefix. MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQLJavascript(lambda.Body, null); mapFilter.SqlWhere = "FacilityReportID IN (select p.FacilityReportID from WASTETRANSFER p where " + mapFilter.SqlWhere + ")"; mapFilter.SetLayers(filter.ActivityFilter); return(mapFilter); }
public static MapFilter GetMapJavascriptFilter(PollutantReleasesTimeSeriesFilter filter) { //parameter must be "p" to match map config file ParameterExpression param = Expression.Parameter(typeof(POLLUTANTRELEASE), "p"); Expression exp = LinqExpressionBuilder.GetLinqExpressionPollutantReleases(filter, param); Expression <Func <POLLUTANTRELEASE, bool> > lambda = Expression.Lambda <Func <POLLUTANTRELEASE, bool> >(exp, param); // create sql and sectors to map. Do not remove parameter prefix. MapFilter mapFilter = new MapFilter(); mapFilter.SqlWhere = LinqExpressionBuilder.GetSQLJavascript(lambda.Body, null); mapFilter.SqlWhere = "FacilityReportID IN (select p.FacilityReportID from POLLUTANTRELEASE p where " + mapFilter.SqlWhere + ")"; mapFilter.SetLayers(filter.ActivityFilter); return(mapFilter); }
public async Task <string> ExpertsListMapZoom(string categoryId, string lat, string lng, string distanceRadius, bool hasReviews) { var client = new RestClient("https://api.iamnearby.net"); var request = new RestRequest("/v1/catalog/experts", Method.POST); if (userMethods.UserExists()) { client.Authenticator = new HttpBasicAuthenticator(username: "", password: userMethods.GetUsersAuthToken()); } request.AddHeader("Content-Type", "application/json"); request.AddHeader("Device", device_info_prefs.GetString("device_json", String.Empty)); request.AddHeader("deviceToken", device_info_prefs.GetString("firebase_token", String.Empty)); var distanceRadiusDouble = Convert.ToDouble(distanceRadius, CultureInfo.InvariantCulture); var coords_obj = new Coordinates { latitude = lat.Replace(',', '.'), longitude = lng.Replace(',', '.') }; var center_obj = new CenterForMapFilter { latitude = /*Convert.ToDouble(*/ lat /*, CultureInfo.InvariantCulture)*/, longitude = /*Convert.ToDouble(*/ lng/*, CultureInfo.InvariantCulture)*/ }; var map_filter_obj = new MapFilter { center = center_obj, distanceRadius = Convert.ToInt32(distanceRadius), hasReviews = hasReviews }; request.AddJsonBody( new { categoryId = categoryId, offset = 0, count = 10000, mapFilter = map_filter_obj, filter = map_filter_obj, coordinates = coords_obj, }); var response = await client.ExecuteTaskAsync(request); return(response.Content); }
public void It_Should_Return_An_Error_When_Trying_To_Map_A_Non_Dictionary() { // Arrange var mapFilter = new MapFilter(LiquidString.Create("field1")); var liquidCollection = new LiquidCollection { LiquidNumeric.Create(123), LiquidString.Create("Test") }; // Act var result = mapFilter.Apply(new TemplateContext(), liquidCollection).SuccessValue <LiquidCollection>(); // Assert Assert.That(result.Count, Is.EqualTo(liquidCollection.Count)); Assert.That(result[0].HasValue, Is.False); Assert.That(result[1].HasValue, Is.False); }
public void It_Should_Return_None_Where_A_Field_Is_Missing() { // Arrange var array = CreateArray(); var field = "field2"; var dictionaryValues = array.Select(x => x.Value).Cast <LiquidHash>().ToList(); dictionaryValues[1].Remove(field); //array.ArrValue[1].Value.ValueAs<LiquidHash>().DictValue.Remove(field); //((LiquidHash) array.ArrValue[1]).DictValue.Remove(field); var mapFilter = new MapFilter(LiquidString.Create(field)); // Act var result = (mapFilter.Apply(new TemplateContext(), array).SuccessValue <LiquidCollection>()).ToList(); Assert.That(result.Count(x => !x.HasValue), Is.EqualTo(1)); }
public void It_Should_Extract_The_Property_From_Each_Element() { // Arrange var array = CreateArray(); var field = "field1"; var mapFilter = new MapFilter(LiquidString.Create(field)); // Act var result = mapFilter.Apply(new TemplateContext(), array).SuccessValue <LiquidCollection>(); // Assert var dictionaryValues = array.Select(x => x.Value).Cast <LiquidHash>(); IEnumerable <String> expected = dictionaryValues.Select(x => x[field].Value.Value.ToString()); //var expected = array.ArrValue.Cast<LiquidHash>().Select(x => x.DictValue[field].Value.ToString()); IEnumerable <String> actual = result.Select(x => x.Value.Value.ToString()); Assert.That(actual, Is.EquivalentTo(expected)); }
private void OnClickType() { MapFilter mask = RTCore.Instance.Renderer.Filter; if ((mask & (MapFilter.Omni | MapFilter.Dish)) == (MapFilter.Omni | MapFilter.Dish)) { RTCore.Instance.Renderer.Filter &= ~((MapFilter.Omni | MapFilter.Dish)); return; } if ((mask & MapFilter.Omni) == MapFilter.Omni) { RTCore.Instance.Renderer.Filter &= ~MapFilter.Omni; RTCore.Instance.Renderer.Filter |= MapFilter.Dish; return; } if ((mask & MapFilter.Dish) == MapFilter.Dish) { RTCore.Instance.Renderer.Filter |= (MapFilter.Omni | MapFilter.Dish); return; } RTCore.Instance.Renderer.Filter |= MapFilter.Omni; }
/// <summary> /// /// </summary> /// <param name="geom"></param> /// <param name="ldr"></param> internal GrassLayer(PagedGeometry geom, GrassLoader ldr) { mGeom = geom; mParent = ldr; mDensity = 1.0f; mMinWidth = 1.0f; mMinHeight = 1.0f; mMaxWidth = 1.0f; mMaxHeight = 1.0f; mRenderTechnique = GrassTechnique.Quad; mFadeTechnique = FadeTechnique.Alpha; mAnimMag = 1.0f; mAnimSpeed = 1.0f; mAnimFreq = 1.0f; mWaveCount = 0.0f; mAnimate = false; mShaderNeedsUpdate = true; mDensityMap = null; mDensityMapFilter = MapFilter.Bilinear; mColorMap = null; mColorMapFilter = MapFilter.Bilinear; }
public MapDetailsViewModel GetMapDetailsViewModel(MapFilter filter) { var startDate = DateTime.Parse(filter.StartDate); var endDate = DateTime.Parse(filter.EndDate); var city = _core.GetCityFilter(filter.City); if (city == null) { return(null); } var spotIds = _core.GetEventSpots(city, startDate, endDate); var addresses = _core.GetAddressesFromSpots(spotIds); var geolocations = _core.GetGeoLocations(addresses); var centerGeolocation = _core.GetGeoLocation(city); return(new MapDetailsViewModel { Geolocations = geolocations, CenterPosition = centerGeolocation }); }