This project has moved and is read-only. For the latest updates, please go here.

Select (rectangular) region with mouse

Topics: Data Access, General Topics, Algorithms, SharpMap v0.9 / v1.x, SharpMap v2.0, WinForms Controls
Sep 27, 2007 at 10:02 AM

this is my first question in this forum, and I hope not last :)
The question is very simple, but because I've not worked with SharpMap too much (practically only install and try some examples), it's a little bit difficult for me to find out the right point to do some, I think, easy thing(s). Moreover, it would help me to see, if such things are really simple.

The question is how to interactive select (only with border or transparent filled) rectangular region with the mouse and show the region corners geoposition within selection.
The 2.nd question is little bit geo-mathematically: how to till such region in NxM subregions and show the tilled geometry and how to highlight and select each "line" with the mouse, also store and restore from XML.
The 3.nd, and may be the last question for today :))) is if it possible to simulate (and show) the "thing" (big round or squared point) moved (slowly) on generated subregion bounds and shows it geoposition and how to "catch" the "thing" with the mouse.

I use the last release candidate, this must be V0.9.

Many thanks in advice to all which can help to get the answers!

P.S. Knows somebody how long it can take to get new V2.0 release, especially for WPF?
Sep 28, 2007 at 8:40 AM
Hi Alex -

For the drawing of a selection bounds, you have to do this yourself in v1.0. In v2.0, it comes in the box. This is the same for question 2: selection and highlighting of features is built into v2.0, but in v1.0 you have to do it yourself. To answer the last question, v2.0 Beta 1 is getting a few last problems worked out, and should be available this weekend or early next week. There's always the source, though. ;)

I don't think I understand your question #3. Perhaps you could clarify?
Sep 28, 2007 at 10:37 AM

many thanks for your answers!

If I understand correct: the solutions for ans 2.nd problem is to draw a "raw rectangle" or "raw lines" over generated image (for mouse rectangle or tiled rectangle) with i.e. GDI+ functions and there are not appropriate functions in SharpMap V0.9 engine to do this elegent with layers or something else.

I'll try to explain the 3.rd question: some visible "point" (circle or square) goes autonomiously moved (can be triggered by clock event) over the map on predicted lines (see Q.2), fires event with geocoordinates each time there are got changed and it will be possible to get event if the mouse is over the "point".

But may be it's really better to wait for V2.0 :)))
Sep 28, 2007 at 5:25 PM
That's correct - you have to do both the drawing of the GDI primatives as well as the computation of the selection of features in world space.

Let's see if I'm closer to understanding the next question... I'm imagining a set of features which are drawn highlighted in some way in the map view. Over some repeating period of time, some glyph is drawn on top of each one of these selected features in turn. When the user mouses over the glyph, some event is generated. Is this what you are describing?
Sep 30, 2007 at 11:54 AM

it can be probably described this way if we use the same words to descibe the same things :)

This is only one glyph turning around the selected features (lines).

Other desciption can be easily understand: some (ractangular) area (say N x M meters in dimension) is to explore with the same vehicle with a given precision (say N/a x M/b pices) - such as in vehicle tracking system, but the vehicle movement is not tracked but simulated.

Btw: the "simulated" vehicle positions (and later much more) will be transfered on the other machine over the same (WLAN or LAN) network in an established manner and "tracked" (viualised) on the same other mashine (of course the stuff can done on the same mashine with other application on a loopback adapter).
Oct 14, 2007 at 1:02 PM
Edited Oct 14, 2007 at 1:05 PM
Hi codekaizen!

Now I'll hardly reopen the discussion, because some of features are now builtin in V2.0.
Is it possible, you provide me the necessary information about how to implement the demanded interactive and highlighted map details?

Many thanks!