By default map viewer responds to map click with dragging map around viewer. I'd like to create functionality wher user can click, draw rectangle and map zooms into this rectangle.
Is this supported by map or is there any way to achieve such behavior?
Adding Shapes to bing map
and after adding the shape you can change the zoom level of the map
Related
I am using media capture element as a child of xamlhost:WindowsXamlHost
Is there a way to add a zoom capability to the media capture ?
I tried the below method:
I added a SliderControl for zoom.
But the _mediacapture's below mentioned properties are not supported.
_mediaCapture.VideoDeviceController.ZoomControl.Supported
_mediaCapture.VideoDeviceController.Zoom.Capabilities.Supported
Hence change in the zoom value is not impacting the image.
I'm building an application with an interactive map (using the ArcGIS API for WPF) that runs on the Microsoft Surface 2.0 (now known as PixelSense). In my application I have a librarycontainer containing elements that a user can drag out and place on a certain location on the map. I achieve this by placing a scatterview (that envelopes the entire map) in an elementlayer on the map, like this:
<esri:ElementLayer>
<esri:ElementLayer.Children>
<local:DragDropScatterView esri:ElementLayer.Envelope="-19949487.9573175,-20100080.1372686,20125528.7282505,20131479.5822274" x:Name="ScatterLayer" Background="Transparent" Height="Auto" Width="Auto" ItemContainerStyle="{StaticResource ScatterItemStyle}" />
</esri:ElementLayer.Children>
</esri:ElementLayer>
The problems occur when a user zooms in or out on the map, causing the elements that have been placed in the scatterview to change their position completely.
To fix this issue I tried placing the scatterview inside a viewbox. When I do this, the elements maintains the right positions in the map, but now a new problem occurs: The elements scale up and down when I zoom in and out of the map (e.g. when the map is shown in full extent, the elements are almost invisible), while the preferred behavior is that the elements maintain their size when a user zooms in or out on the map (e.g. like the markers in Google Maps).
Does anyone have a suggestion as to how I can solve this problem?
Cheers
Instead of putting the ScatterView in a Viewbox, you should do the following:
After a ScatterViewItem is placed on the map, transform its Center point (which is in viewport coordinates) to a location in world coordinates (latitude and longitude). The ArcGIS API should provide such a transformation.
When the map is zoomed or otherwise transformed, transform each world location back to viewport coordinates and set each ScatterViewItem's Center property accordingly.
In order to store the world coordinates for each ScatterViewItem, you could create an attached property.
Is it possible to set the opacity of the tiles in google maps v3?
I have see in done for overlays but I want to make the actual map tiles slightly transparent.
Why would you make the tiles transparent, if they'll always be base "layer" for the map? Are you trying to somehow add an overlay behind the map tiles?
You can adjust the map tiles using the style feature of the Google Maps API:
http://goo.gl/3q4ex
I am currently developing a Silverlight OOB application using the Bing Map Control, however I have come across an issue I am struggling to resolve. Basically I have three map layers:-
Base Map (bottom layer)
Icon / Pushpin layer (middle layer)
Shape / drawing layer (top layer)
This all works fine, I have put mouse right click functionality on each of my icons (pushpins if you prefer), if I add a map polygon or polyline to the top layer and this item happens to cover the same area as one of my icons in the middle layer I can no longer get any of the mouse events to fire on my icon.
If anyone can think of a way I can pass the mouse operations from my top layer objects to the middle layer objects please let me know.
Many thanks in advance
Set the IsHitTestVisible of your top layer to false. I feel I need to type more text here but there really isn't much more to say.
It's not clear from your question if you need both the shape and the icon to get the mouse event.
If all you need is for the icon to get the event, then switch the order of your layers so Icon layer is on top.
If you need both shape and icon to get the event, then (if you keep your order with shapes on top) you would need to have some way to tell what icons a shape covers. Do you have a parent/child releationship between them? If not, can you create one? If you set up an event on the shape, and set up OnEvent handlers for the icons that listen to the events, then you can have the icons react as well.
If you are more clear about what your situation is, I could post some code that could help.
In a Silverlight application I have large images which have flow charts on them.
I need to handle the clicks on specific hotspots of the image where the flow chart boxes are.
Since the flow charts will always be different, the information of where the hotspots has to be dynamic, e.g. in a list of coordinates.
I've found article like this one but don't need the detail of e.g. the outline of countries but just simple rectangle and circle areas.
I've also found articles where they talk about overlaying an HTML image map over the silverlight application, but it has to be easier than this.
What is the best way to handle clicks on specific areas of an image in silverlight?
Place the Image and a Canvas in a Grid so that the Canvas overlays the Image.
Add shapes of appropriate sizes and placed as needed to the canvas. All shapes will a transparent fill and no border, hence the user only sees the Image. On the Canvas MouseDown (or Up events) use OriginalSource to determine which shape generated the click. Use the Tag property of each shape to associate it with some object that represents the flowchart element being mapped.
I found an easy way to do this without a canvas:
How to get the coordinates of an image mouse click in the event handler?