I'm working with Xamarin.Forms (2.3.3.180) Map and added many polylines on it. But when I turn on "traffic" its layer are above my lines. Error is on both Android and iOS systems. I have been tried to do something with custom renders but in vain.
If i added customTileLayer its also displayed over polylines and another Map elements.
I have't found the way to find a solution. native maps have't field layers, only tile layers.
You're right, the Traffic can only be disabled/ enabled, we can't change its layer. I've tried to change the layer of Polyline by setting polylineOptions.InvokeZIndex(3000);, and tried to increase this Z index, but it doesn't help.
By checking the official dev documents of google map, I didn't find any thing useful for this issue either. So basically it's not xamarin's problem, this feature is for now not supported by Google map.
You can check the issue report here: Bug: Traffic data is displayed above drawn shapes (polylines).
I think what we can do here is either increasing the width of Polyline or disabling the Traffic. If you want to increase the width, you can for example code like this:
polylineOptions.InvokeWidth(30);
Related
I've been searching for a bit on how I can display scalable media on top of a WPF Bing Maps MapControl, but I cannot find any example code or a solid solution to my problem.
Here is the control documentation:
https://learn.microsoft.com/en-us/previous-versions/bing/wpf-control/hh750210(v=msdn.10)
I'm generating a grid that represents a density map, which then becomes a bitmap image. This is fine, I have the image. How can I overlay this image onto the map with some transparency such that the user is able to move and scale the map if necessary?
My initial thought is to create a tile layer and add it to the map control since I know the size of each square and its lat/long, but there doesn't seem to be many examples of anyone doing this online. The documentation is somewhat scattered as well, and more heavily focused on UWP:
This appears to be exactly what I need, but it is a UWP control - https://learn.microsoft.com/en-us/windows/uwp/maps-and-location/overlay-tiled-images#overlay-tiles-from-local-storage
This also appears to be useful but only has XAML code, no actual C# showing what the buttons do...
https://learn.microsoft.com/en-us/previous-versions/bing/wpf-control/hh868033(v=msdn.10)
Okay, the next thought was to make the image, then scale it appropriately and overlay the media onto the map using this documentation, but again, only XAML code is shown as an example. https://learn.microsoft.com/en-us/previous-versions/bing/wpf-control/hh868032(v=msdn.10)
Has anyone done something like this in WPF? I'm a bit lost.
Thank you.
I've been working with GoogleVR on Unity for quite a while now and the application I'm developing actually needs to be able to have a higher field of view than the one offered by Google Cardboard, since I'm trying to see my hands through the app and I need to really stretch my arm if I want that. I tried setting it manually by code and couldn't find a way to do it. I also tried increasing the resolution of the camera but also couldn't. I also tried setting a fixed DPI on the Resolution Scaling Mode on Unity, but then the GoogleVR framework broke and didn't work when I did that. I have also tried setting a custom cardboard profile and tested with a lot of different ones, but none of those increased the fiel of view significantly.
Does anyone has any idea on how to solve this?
Thanks!
You don't want to change "mockFieldOfView". That only affects the
in-editor FOV. The value you want to change is "matchMonoFOV" on the
StereoController. You also have to set a "CenterOfInterest" game
object on the StereoController. It makes the stereo FOV attempt to
match the FOV on the Main Camera (or whichever camera has the
StereoController script).
I think this is what you are searching for:
Unable to change FOV of the google card board camera
I am working on a .Net WPF app that displays fixed network gateways (switches, routers) inside an office premises.
I am looking at represent the office plant on 2D view, and dynamically/automatically place items on it that represent those network devices to give an overview of their position.
I have thought about storing the coordinates XY (pixel) with the HW Details, so the end-user can just adjust those coordinates to move the device to a new position on the image.
1. Will this work?
2. Is this a very rudimentary solution? Will it adapt if the Window size changes.
3. Can anyone recommend a Nuget Package ?
4. Can anyone recommend me an algorithm?
Appreciate your help.
Regards
There is a nice DragCanvas Demo at codeplex. Which shows a lot of what you want to do.
You can resize the window and handle the event to resize all the controls on the canvas but it sounds like if this solution just used inside your company, I would avoid the extra code just allow a reasonable fixed window size so you can store the offsets of each network image and restore them when the program is reloaded (but yes you can do it).
Yes this will work
You do not need a complex solution?
No packages needed.
algorithms not really needed. ( google "resizing canvas controls")
Figure out how you want to save/load the positions in file or Db and you are done.
I'm developing a Windows Phone 8.1 app. The main focus of this app is to provide a birdseye view of incidents on the road.
Since it's a Windows Phone App I decided Bing Maps was my only option.
I'm using the MapIcon class to display the incidents on the road.
However just as the documentation says:
The MapIcon is not guaranteed to be shown. It may be hidden when it
obscures other elements or labels on the map.
My Markers only appear when almost zoomed in at max.
I tried working with dedicated XAML UserControls but this messes up the reponsiveness of the markers A LOT!
When I manipulate the map the icons are very shaky. It is not like MapIcon, that is always in the exact location.
How can I have a MapIcon that will always be visible? Can I define some hierarchy?
Thanks in advance
This is not possible (yet). The safe only option for you is to use XAML elements which are - as you already pointed out - guaranteed to be shown.
However there are couple of things you could try in order to get your MapIcon to work / increase your app's performance:
Depending on the complexity of your map icon: why not draw the MapIcon as a composition of MapPolygons and Polylines? It's almost like vector graphics. Just keep in mind that the MapControl will not render polygons with holes or self-overlapping polygons.
Only display XAML elments when necessary. Use IsLocationInView() extensively. Avoid unnecessary manipulations at all cost.
There is another interesting topic on the performance question here: How to improve Windows Phone 8 Map control performance
Problem Overview
I am working on a game application and need to be able to implement scrollable maps in Silverlight similar to those found in Google Maps. However, I am unsure as to how to implement this effectively. The following paragraphs provide much additional detail. Any ideas or guidance is greatly appreciated!
Problem Detail
I have been working on a new MMOG (massively multi-player online game). The game will implement a coordinate (x,y) based map. Only a very small fraction (less than 0.1%) of the map will be displayed on the screen at any given time. The player should have the ability to click on the map and drag the mouse to scroll and view map areas which are not presently visible. (This is somewhat similar to Google Maps.)
The map background is made up of a series of stitched (repeating) images. These images are woven together to give the basic appearance of the game's "world". A standard set of additional graphics are then superimposed, as appropriate, on each of the coordinate locations . For example, point (0,0) might be a lake, (0,1) might be a city, and (0,2) might be a forest. The respective images for a lake, a city, and a forest would be superimposed on the background.
It is important to mention that the entire map is NOT stored on the local client machine. Rather, as a player scrolls to or opens a specific location, the appropriate map information is retrieved from the remote game server. It is infeasible for us to build the entire game world map ahead of time due to its size and the fact that portions of the map are constantly changing.
I have toyed with the idea of building a bitmap on-the-fly of the new map each time a player moves. However, I think there may be a much better way to add to the map as the player scrolls.
When scrolling, movement of the map should not, if possible, result in a "flickered" refresh of the screen. I believe recreating a bitmap each and every time a player moves even one or two pixels would almost certainly result in flicker.
I am open to 3rd party tools and solutions. However, to the degree possible, I would prefer to use standard Microsoft libraries or open source tools rather than commercial tools.
What are some ideas as to the best way to implement this functionality so that it performs well, is reliable, and transitions to new areas of the map appear seamless to the player?
Thank you in advance for all your help!
Update
Here are a few pieces of additional information that may prove helpful.
Since my initial post, I have been introduced to the concept of a "tile engine". (Many thanks to Michael and Paul for pointing me towards Bing and BruTile.)
My understanding is that a tile engine basically breaks larger images into sections and renders them side by side. As a user scrolls, additional tiles are rendered as others are removed from view. This is very much what I am looking for.
However, there may be a couple of wrinkles that affect my use of a standard tile engine. All of the graphics for the game, including the backgrounds which would be displayed on any tile, will already be downloaded on the client. It is important that the tile engine not retrieve the graphics from a server as this would consume significant unnecessary bandwidth.
Other graphics (e.g. a lake, forest, hill), which represent objects from the gameworld, must be superimposed when the tiles are rendered on the screen. Tile engines such as Bing appear to provide the ability to superimpose custom images. Whatever tile engine is used must not only support this feature but allow exact placement of these superimposed images.
Finally, there is a a requirement to support popup descriptions when the user mouses over one of the superimposed graphics. Unlike the graphics which are already stored on the client, the descriptions contain information which must be downloaded from the game server. BruTile, while excellent in many ways, does not appear to yet support these popup descriptions.
We are making great progress. Thanks for all your help so far!
For an open source solution you could look at BruTile. It too has all the features you describe. It can also be used on the Microsoft Surface and on Windows Phone (for your markeplace version).
Use the Bing Maps control or the MultiScaleImage (Deep Zoom) which it uses.
To seen an example, go here. You can use the Deep Zoom Composer to create maps or topologies using your own photos and images.
Here is the SDK for the control.