I would like to order "circle" features in a layer in Mapbox studio. The entire Style, including this layer and other layers, is added to a map using GL.JS, and symbology for the layers are set in studio.
I see the documentation for circle-sort-key for gl-js style specification, but don't see where to set it along side the other properties (raduis, color, opacity, etc) for the layer style in studio.
Yes, it appears you can't set it within Studio.
However, you can set it using JS if you want:
map.setLayoutProperty('mylayer', 'circle-sort-key', ...)
Since the documentation doesn't give a detailed example, I'm adding my final solution here.
Following #steve-bennett's suggestion, to sort the smallest circles on top:
map.setLayoutProperty('layername','circle-sort-key',["*", -1, ["get", "propertyname"]])
Related
I have a requirement where I need to highlight the buildings around my current location on a map. I am using Xamarin and was wondering if anyone can point me to a correct library or control that can fulfill my requirement.
I am currently using Mapsui for Xamarin but I don't think it has the feature I am looking for.
If you have access to the geometries of the buildings there are many ways you could implement highlighting.
One way that comes to mind. Create a layer on top of your background layer with the same geometries as data source. Use a ThemeStyle to show only the selected geometry. The ThemeStyle class is created with a callback method which determines the style. In that method you should return no style unless the feature id is the same as selected feature id.
You can take a look at the ThemeStyle sample for a more general use of themes (no highlighting).
Also you could look at Mapsui.Sample.Wpf.Editing. Here is a screenshot of that sample:
This is in reference to:
No Transparency on Visual Basic PictureBox
To Visual Vincent; First, I'd like to thank you for sharing your efforts with the community... Thank you very much!
I'm not very good at "Class" building. I've never implemented class modules very efficiently. I understand the principals, but tussle with mapping the properties and events before creation.
Anyway, does this example work in VB6? If so, how?
When I paste your example code into the class module code window, much of the text is red.
You can try my AlphaBlendImage control for VB6 built-in VB.Image control replacement w/ added support for transparency.
It supports both key-color transparency where you choose one color (e.g. magenta) to become transparent and true alpha-channel transparency like in PNG files.
You have to load PNG files with it's GdipLoadPicture function to preserve the alpha-channel transparency still by using built-in StdPicture instances. Take a look at the sample in test/basic directory for more info.
I am using the Alloy framework to build a mobile application in Appcelerator Studio. To build the user interface i am using the *.tss files (sort of css) and using constants like Titanium.UI.SIZE or Titanium.UI.FILL for the width and height properties of the UI components.
I was wondering if there is a sort of css CALC method available in the Alloy framework, such that is possible to do size calculations like this:
width: calc(Titanium.UI.FILL - 20px)
height: calc(80% - 30px)
Thanks in advance!
If you are setting the width or height inside the .tss file, you have to set the value to an property of the Alloy global object (Alloy.CFG.yourVar or Alloy.Globals.yourVar).
alloy.js
Alloy.CFG.width = Ti.Platform.displayCaps.platformWidth - 20;
view.tss
"#myView":{
width:Alloy.CFG.width
}
If you set the value in your controller, you don't need to use like a global object property.
index.js
$.myView.width = Ti.Platform.displayCaps.platformWidth - 20;
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Platform.DisplayCaps-property-platformHeight
TSS (Titanium Style Sheet) is not CSS. It purely declarative json file - but you can use some Titanium code inside it like Ti.UI.FILL or Ti.UI.SIZE or for translation you could use the L() function.
As a solution for having calculated values, I see 3 possible ways:
Pre-calculating what you need as part of an app bootstrap inside alloy.js, and storing it in alloy as part of a "namespace" - do note that it will reside on the "global scope" - but I don't think that's what's going to bring your app down. So you would have something like this:
Alloy.js:
Alloy.UI.MyScreen.MyComponent.height = DO YOU CALCULATION HERE;
ControllerStyle.tss:
"#myComponent" : {
height: Alloy.UI.MyScreen.MyComponent.height
}
Make sure you build your namespace right and use closures to not pollute the global scope.
For more information on alloy.js see here: http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Controllers-section-34636384_AlloyControllers-InitializerFile(alloy.js)
A second solution would be to use Dynamic Styles. See here: http://docs.appcelerator.com/platform/latest/#!/guide/Dynamic_Styles
Third solution would be to apply the properties you need in your controller code - this one is my least favorite because it forces you to "cross the bridge" between js and native when your controller loads and slows you down.
One thing you can do is pre-calculate it, another is set the calculated width not in tss but in the controller file.
What I tend to do, when I need to calculate something like this is pre-calculate this and use it throughout the app if there is more than 1 purpose of using it. Do this for example in alloy.js
Alloy.Globals.marginContentWidth = 300;
Or you can use any contant from the Ti Platform to calculate something. Now in tss you can use this
"#myUI": {
width: Alloy.Globals.marginContentWidth
}
This will work for you.
Another thing is not thinking about mobile UI like you do with a website. On mobile you need to think more flexible. One of the reasons you probably want width - 20px is because you want margin of 10px on both sides.
First off... don't use px. In mobile development you need points, or dp, but this is default so you can just use 20. To handle it more flexible, do this:
width: Ti.UI.FILL,
right: 10,
left: 10
This should fix your problem nicely
First of all .tss is not a sort of .css :), rather it is sort of json file.
Now what you want to do, you will need to learn Alloy & Titanium a bit deeper as you can do every sort of calculations in Titanium but there are other ways and perhaps since you are comparing it to .css, you are not getting it right.
So, I suggest you to first learn what Alloy & Titanium is and how they work and how they support each other.
You can always head on to the Titanium Docs which are absolutely clear to get you started on a right path. First give them a try, take time to learn things and we are always here to support you. :)
Good luck!
I am trying to create a eclipse based editor for class diagram for a school project. One of the main requirement is that the diagram need to have a "sketchy effect" (something like the one shown in this website yuml)
I am new to Eclipse graphical editor frameworks, and I want to get some opinion about how I can implement it (pros/cons of using plain GEF vs GMF). My preference will be to use GEF as it may require a lot of customization in the future and I find that GMF has a high learning curve and not much documentation.
If I implement it using GEF, will it better done by using SVG graphics and should the figure or edit parts be splitted (to three parts : box for Class name, box for Properties, and box for Methods)?
Think it's best to use SVG for the sketchy shape. GEF doesn't have support for SVG images, GMF does. You can try to borrow SVG handling from GMF - it's not too complicated.
Properties and methods should be text labels figures and children of properties and method compartment figures that are nested inside the class shape. See this: https://eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2d.html
What are the recommended colors for an application's background, button faces, etc.?
In the past I've just chosen a color scheme but I'd like to be more compatible with the Windows Accessibility Options, etc.
I see that VB6 has System Colors like Application Workspace.
Edit: I'd like to find an explanation of all of those colors (like what's the difference between Application Workspace and Window Background?
In my opinion, you should leave the colors as they are if you are using standard controls; they'll get the right color according to che current color scheme by themselves. You need to use the color constants only if you have to draw your own UI elements; in that case, the meaning of those constants is explained briefly in their documentation.
This PDF http://www.johnsmiley.com/cis18/Smiley009.pdf [ explanation of VB6 System Color values ]should help you. It lists all the system color constants and what they mean. For instance vbApplicationWorkspace is the "Background color of multipledocument interface (MDI) applications."
If you're interested in the whole MS Windows UI/UX guidelines, they are available online here and for download here. Page 618 deals with how to "Use theme or system Colors"
It depends on the language and framework you use. .Net for example has an entire SystemColors class full of static properties like SystemColors.Control that are 'changed' to the corresponding system color in runtime.
I think most office applications conform to the system colors, while most graphics intensive applications (e.g. games) use their own color scheme.
It is best if you try to use the colors of the current system (like the .NET SystemColors), that way if the user changes his settings (for example if he uses a high-contrast color scheme or some fancy black theme he likes) your application will adapt those colors and that way conforms to the users preferences/needs.