Z-index of map objects - xamarin

Is it possible to specify Z-index of map objects in Carto Mobile SDK?
I am creating some objects on the map, but I can't control its z-index. I understood that the more closer to bottom object is situated the more closer to user it is displayed (z-index bigger). However, do we have ability to specify it manually?
Problem is in the popup I want to show to user. It is displayed under all map markers.
Xamarin.iOS is used.

For Billboards like Popups and Markers you can set placement priority to larger than 0 (which is the default). This is given in Style level, via StyleBuilder:
BalloonPopupStyleBuilder builder = new BalloonPopupStyleBuilder();
builder.PlacementPriority = 1;

Related

How to have grid layout components with different cell heights in Unity

I am trying to build a scene in my 2D game which has a panel whose elements are arranged as in this image:
The ScrollRect should dynamically add rows after users provide values to the InputField, select an option from the Dropdown, and then click the Button. This all works fine, except that the viewable area of for the ScrollRect has the same vertical size as its siblings within the parent panel.
This happens because the GridLayoutGroup of the parent panel requires the child cell sizes to be specified, and if I specify a value which makes sense for the top two panels it is too short for the ScrollRect. Putting a ContentSizeFitter on the parent panel does not help (also, despite Unity warning against it, there is a ContentSizeFitter on the content of the ScrollRect since without one the newly added rows will not appear when scrolling).
So my question is:
what do I need to do to allow the vertical sizing of the children of the top level panel to be based on their sizes, when one child's vertical size will change dynamically?
Thanks!
For grid layout you cannot control the cell sizes dynamically . Instead you can use horizantal / vertical layout groups where you can find an option control child size . And as mentioned in above ans add Layout element to child component and adjust the sizes
Both #Programmer and #Salma572 answers are true. If you want that size to be a fixed number or pixels, use a LayoutElement. However, It doesn't seem you can use a scale (in percent) or anything else dynamic.
It's a shame but you'll probably need to write a script.
It is possible. Attach Layout Element component to each child GameObject. You can then dynamically change the size of each child GameObject by modifying the Layout Element's Preferred Width and Height variable.

Qt Quick: Can I use the layout components for item layout, without the overhead of rendering the items to the window?

I want to render a QML subtree manually to a Canvas3D by having all the subtree's items' be-texture-source flag (layer.enabled) enabled, and taking the geometry (x, y, width, height) of each item from the corresponding QML properties of each item (calculated by layouts, anchors, etc), so I know how to position and size each item with OpenGL calls.
I have no problems with implementing this, except for a performance issue: since I'm drawing the items in OpenGL, I don't want Qt to also draw them to the window (this would be doing the same work twice). I could achieve that easily by setting opacity: 0 on the items, but that would probably only fix the visual problem, it wouldn't save performance. I could also set visible: false but then I think the layout components wouldn't be able to do their job correctly.
The reasons I want to implement the described architecture are:
I want to implement custom rendering for some of the items in the subtree, but still use their positions and sizes (calculated by the layout for me) for the custom rendering. This custom rendering is complex enough that it can't be done with QML features alone, and I don't want to use Qt3D.
I could use use another approach: use a separate Canvas3D for every item that I want to render customly. And let Qt Quick render the rest of the items for me normally. That's what I've been doing until now. The problem, however, is that:
The different Canvas3Ds can't share GL resources, so I need to initialize and keep copies of the GL resources in each Canvas3D. This increases load time and memory usage.
The creation time of each Canvas3D (even without my GL init code) is significant, I think
So instead I want to use a single, big Canvas3D.

wxPython -- GetSize doesn't return actual size

I have a Notebook and add two panels to it. When I try to get the usable area of one of the panels, it returns (20,20) -- I imagine this is its size before stuff is put in. I want to get this size before I put stuff in because some proportions depend on it and I'd prefer not using absolutes.
I haven't set an actual size, I just sized everything with a boxsizer and set proportions. I'd like to get the actual pixel width of the area allotted to the panel (it doesn't take up the entire program window area).
I've tried calling Layout before GetSize, I've tried GetVirtualSize and Get ClientSize and any other available size returns, still (20, 20) or sometimes (10,40). I've tried getting the parent size, no go. I get the grandparent size and it shows correctly, but this is the size of the entire program window. Is there a way to get the potentially usable area of a panel? If need be, I can post the layout, but it's long.
It sounds like you are trying to do this at the time of the creation of the window, before the initial layout and sizing is done, so everything still has its initial size. There are some alternative ways to deal with this situation. You could delay creating the content of the panel until the first size event. Or you could design your sizer layout to be adaptable to any (resonable) size. Or you could adjust/redo the sizer layout later if needed.
Or perhaps the easiest would be to send a fake size event to the parent or top-level parent so they will do what their normal layout resizing the child windows, which will cascade to your panel. This may not work in all situations, but it is common enough that there is a window method for it, SendSizeEvent.

Custom elements in watchkit

I was reading Apple Watch Human Interface Guidelines and i'm curious if there is any way in displaying custom UI elements, other than those provided by default by Apple (like tables, buttons or labels). How did they managed to do this:
Did they use images?
While we haven't seen everything that Apple are doing with the core Watch OS apps, it is already clear there are many API functions that they are reserving for their own use at this stage. It's almost certain they were using some of those API functions to create these views.
There is no way to create truly custom UI elements with the current WatchKit API (i.e. entirely new custom classes doing custom drawing). That said, with some creativity, it would be possible to create most of the interface you depict with the current tools available to third party developers. This is almost certainly not the way Apple created it, but you could:
Create a group.
Put inside the group a button with a background image that represents one state of the coloured circle.
At runtime, visually animate the button image as needed by swapping through multiple images that rendered the various states of progress of the circle x colour options. Yes, the starting point would be thinking about 360 images for the circle states x the number of tints. (It is possible to apply a tint to a template image in WatchKit, but as far as I am aware you cannot apply a gradient.)
Add two labels to the group for the large number and subscript, and align both of these to be centred vertically and horizontally in the group.
You can set the tint of the page title at top left by setting the global tint of the application. By changing the global tint at runtime you could change these for each page.
It is not currently possible to change the colour of the page dots at the bottom. These are not set by the global tint and it is not possible currently to change these programatically.
Apple have indicated that later in 2015 third party developers will be able to build fully native apps, but even then, they have not given any indication of whether the API functionality available to us is broader, or whether our API will be essentially the same as it is now, with the one addition that at least some of the current WatchKit App Extension code will be able to run on the device when the iPhone is not present/charged.

How to define displayed area of map control at startup in wp7?

This might be little bit novice but, how can i set initial displayed area of map control in wp7? I mean, when i changed zoom level from properties, it shows closer look to the map. But i don't know how to make it display europe at startup.
You could use the SetView method of the Map control, passing to it the location you want to center on and a particular zoom level :-
http://msdn.microsoft.com/en-us/library/gg588591(v=vs.92).aspx
http://msdn.microsoft.com/en-us/library/gg588382(v=vs.92).aspx

Resources