.NET Development: Fence
1 to 8 of 8
-
- CommentAuthortechquery
- CommentTimeFeb 10th 2011
Hi.
Is there a way I can put a fence that is the same size with the map area?
I was hoping not to redraw the map when the current location of the vehicle is inside the fence and when the current location is outside the fence, i want the marker/pushpin to be in the center of the map.
Please let me know how to achieve this.
Thanks! -
- CommentAuthorSharonD
- CommentTimeFeb 10th 2011
You can use MapCtrl.XYtoLatLon to calculate the latlons of your map corners, then create a RectangleFence using these latlons. To decide if a location is inside the fence, you can use RectangleFence.Contains(latlon).
We don't quite understand the second part of your question. Why is the map redrawn? What are you trying to achieve? And what problem have you got?
GeoFence is used when you want to avoid a given area in routing. If you just want to decide if a location is within an area, you can use BoundingBox.Contains(latlon). In this case no fence will get rendered on the map.
Regards,
Sharon -
- CommentAuthortechquery
- CommentTimeFeb 11th 2011
Oh okay..so bounding would be the right choice I think since that is what I am trying to achieve. I want to decide if a location is within an area. So how do I create a bounding box that is the same size with the Map?
Correct me if I am wrong, It is redrawn because I was using MainMap.center = _myLocation and MainMap.Invalidate(true). I want the map to stay as is and update only the PushPin if the location(lat,long) is still in the map area, until it keeps out of the map area, that is the time I wanted to call the "MainMap.center = _myLocation". -
- CommentAuthorSharonD
- CommentTimeFeb 11th 2011
You can create a BoundingBox(), and then call Add(latlon) twice to add the min and max points. The locations of these points are come from MapCtrl.XYtoLatLon methods. By the way, MapCtrl also has Contains(latlon) method, which checks if the latlon lies within the current map.
Now I understand what you are trying to do, however at the moment it is not possible to add a pin to map without invalidating the map.
Regards,
Sharon -
- CommentAuthortechquery
- CommentTimeFeb 11th 2011
Our application has a video and ticker and by integrating the map (GeoBase) and invalidated, it freezes our video playback and the ticker for sometime. Aside from this, the CPU usage goes up to 65%.
This is the issue we are facing right now and we are eager to solve this with the Telogis Map as we like its features compared to Mappoint. Is there a way to solve this? -
- CommentAuthortechquery
- CommentTimeFeb 14th 2011
Any thoughts? -
- CommentAuthorSharonD
- CommentTimeFeb 15th 2011
Hi,
We are not sure about the video issue . Could you send an email to gbsupport@telogis.com with details of your problem? I think you have already got a support case about CPU usage, so you can also reply that email to add information and files about your video issue.
Thanks,
Sharon -
- CommentAuthortechquery
- CommentTimeFeb 15th 2011
Thanks Sharon. I'll send the details soon.
1 to 8 of 8
