Re-style entire Leaflet vector map on event - leaflet

I want to restyle every feature on a vectorgrid. The specific problem is when you select a section of a bus route, potentially by just a mouse-over, i want to light up all the sections which contain common routes. I have a style callback function. How do I tell Leaflet that I have changed the rules on what colours to use etc.

Related

How to get a reference to markers autogenerated by the creation of the symbol layer?

I need to perform automated actions on individual markers on my map, but based on all the answers I'm finding online I will first need to store references to my markers in my script. However, I am not creating the markers explicitly. Instead it seems the markers are being generated when I load a collection of points from geojson using the map.addSource() and map.addLayer() methods.
For an MCVE see here.
How can I get references to the generated markers using this method?
You are confusing Markers (HTML elements that sit above the map) with a symbol layer (graphical elements that exist within the map). Symbol layers don't generate markers, and there are no "references" to get.

How to position Canvas with agents in classical Agent-Based Modeling in AnyLogic

I'm new to AnyLogic and trying to figure out how Agent-based models should be set there. There is a famous Epidemic model, which I'm trying to reproduce. Most tutorials on classical ABM deal with old GUI settings.
For example, in version 8.5+, which is actual now, the Environment object (that was used for positioning of layouts) has been deprecated.
Now I see that new object Canvas is used to put the layout with agents on the page. But the structure of source code file is a bit unclear for me and I've failed to find relevant description how Canvas can be set for the purpose. (Besides I'm not sure that this is recommended way of doing this task.)
Question: I would love to learn the right way to arbitrary position the area with agents on the page. Below you may see what I get by default.
After some playing around, the 'minimalistic' functionality is as follows.
One should create some population with arbitrary name Person (population name people adds automatically).
The following structure of the Project is to be reproduced (arbitrary names are marked with yellow).
Comment: after adding a Canvas called mapCanvas one adds the function setCanvasCellColor with following body:
mapCanvas.fillCircle(person.getX(), person.getY(), 3, color);
It is clear that former two arguments stand for coordinates of a given point, then its size (i.e. 3) and color. Do not forget to add two arguments used in the body, namely, person as Person and color as Color.
From Entry Action of the statechart named state call the just made function. I've put black color here just for the sake of demonstration; chartreuse constant gets used instead in the Epidemic example.
main.setCanvasCellColor(this, black);
Finally, you may run the model to get the following picture.
Note
If one is reluctant to bother with Canvas, use Main - Presentation - xxx_presentation and click Draw agent with offset to this position checkbox.

Accessing om.next sub-component state

I'm just picking up om.next and have run into a situation where I've got some form inputs realized as components which hold on to local state, e.g. validation state, actual input value, etc--this state is updated and accessed via om.next/update-state! and om.next/get-state. The trouble with this seems to be when I wrap the inputs in a form in a parent component I'm unsure how to get the state held by the input components. Is it better to pass along the parent component as a property of the input component? What about situations where there is no parent component?
It seems to me that there are 2 options for the use case you want to achieve:
pass the parent component as an argument as you said
have an entry in the global app-state that represents the current form being edited, which you can update via transact! irregardless of the component corresponding to the input. This way every component that represents an input knows where in the app-state to update itself (which key in the current form) — probably captured succintly in one mutation function.
1) is probably the easiest to implement given the code you have currently, but I always like to go for 2) because it doesn't deviate from the "single source of truth" opinion that Om Next recommends (and tries to enforce). Form data is in fact business data, which might not be desirable to have scattered in components. Testability is just one advantage that I immediately see from such approach.

Call hierarchy from a certain function

Background:
Working in eclipse, I have two function: do_something and perform_task. I know that do_something calls a number of other functions which in turn call others (and so on and so on) and somewhere down the line perform_task gets called as well.
Since this is a big project, lots of flows and so on, I've already found two different sequences where do_something activates perform_task through some other sequence of functions.
Actuall question:
Is there a way in eclipse to get the call hierarchy of a certain function, but only sequences that will include also a certain other function in the sequence?
Thinking of this in terms of graph paths, we have a directed graph, and instead of asking what are paths to node x, I want to know what are the paths to node x that include node y.
It's not exactly what you're asking for, but might be useful enough:
In the Call Hierarchy view, there's an option to show the callees of the selected method instead of the callers. Look at the view toolbar of Call Hiearchy for the two buttons that depict green dots connected with lines; those button toggle between the two modes.
If you select do_something and open the Call Hierarchy view on it, then set the mode to Show Callees you might be able to explore the various paths out of do_something that lead to perform_task.

remove polygon / polyline from a bing map

With the Bing v7 AJAX control, if it contains several polygons/polylines, and I want to remove all of them at once, how do I go about doing this? I suppose I can loop through the map.Entities collection and inspect each to see if it is a poly* object, but I was wondering if there is an easier way?
When there's a need to handle a group of elements easily I usually place them on an EntityCollection. Then, you can just hide/remove that layer.
Check out this example. It hides the entities instead of removing them, but the principle is the same.