Nokia map embed - hide labels and roads - label

Regarding embedding a Nokia map in a web page:
Anyone know how I can hide roads and names. Like on here.com they have a checkbox under feature to hide 'labels'.
This is what I have so far:
var map = new nokia.maps.map.Display(document.getElementById("map"),
{
'components': [
// Behavior collection
new nokia.maps.map.component.Behavior(),
new nokia.maps.map.component.ScaleBar()
],
'zoomLevel': 18,
'baseMapType': nokia.maps.map.Display.SATELLITE
});

Related

Adding a new view on top in NativeScript

Anyone got a tip how to add a View over the current view (modal)? I'm creating an app with a video recorder, and the video screen is presented modally on the screen. I want some text to show up above the video modal, and I think I've tried any approach I can think of atm.
Currently im stuck with something like:
var topMost = frameModule.topmost();
var View = new ViewModule.View(questionHolder);
topMost.currentPage._addView(View, 0);
But with no success. questionHolder is a view I fetch with
currentpage.getViewById
Edit:
From the answer of #davecoffin where I understood you could not mix native views and nativescripts views, I was able to solve this in my case by accessing the native view directly and adding a subview to it. In my case:
var sharedApplication = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
var overlay = UIView.alloc().initWithFrame({
origin : {
x: 0,
y: 44,
},
size: {
height: 100,
width: platform.screen.mainScreen.widthPixels
}
});
overlay.backgroundColor = UIColor.blackColor;
overlay.alpha = .6;
sharedApplication.keyWindow.rootViewController.presentedViewController.cameraOverlayView = overlay;
You can directly create and use modal pages as described in this article.
If I am understanding your approach correctly...
You cant add Nativescript views on top of native views.
Check out this forum question: https://discourse.nativescript.org/t/appending-nativescript-views-to-a-native-ui-view/1412
Basically once you have appended a native view (not a nativescript layout or ui view), then every view you append after that must be a native view. For iOS you use addSubview, not sure about android atm.

UI for NativeScript RadCharts use labels with decimals by default

I’ve been doing some experimenting with UI for NativeScript’s charts—which are awesome, by the way—but I’m running into an odd problem I can’t seem to figure out.
On Android, the control suite loves to render all of my numeric labels with a decimal point—aka “15.0” rather than “15”. In my case (and probably in most cases) this behavior is undesirable, and I’m trying to come up with a way around this, but I’m not seeing anything in the API documentation.
To give a concrete example of what I mean, here’s the world’s simplest example that shows this behavior in action.
<!-- main-page.xml -->
<Page
xmlns:chart="nativescript-telerik-ui-pro/chart"
loaded="pageLoaded">
<StackLayout>
<chart:RadCartesianChart height="500">
<chart:RadCartesianChart.series>
<chart:LineSeries
items="{{ data }}"
categoryProperty="key"
valueProperty="value">
<chart:LineSeries.horizontalAxis>
<chart:CategoricalAxis />
</chart:LineSeries.horizontalAxis>
<chart:LineSeries.verticalAxis>
<chart:LinearAxis />
</chart:LineSeries.verticalAxis>
</chart:LineSeries>
</chart:RadCartesianChart.series>
</chart:RadCartesianChart>
</StackLayout>
</Page>
// main-page.js
var frameModule = require("ui/frame");
var Observable = require("data/observable").Observable;
var pageData = new Observable();
pageData.data = [
{ key: "One", value: 10 },
{ key: "Two", value: 20 }
];
exports.pageLoaded = function(args) {
var page = args.object;
page.bindingContext = pageData;
};
With this code, on iOS you end up with a vertical axis with keys like “0, 4, 8, 12”, and on Android that same axis has keys like “0.00, “5.00” & “10.00”.
How can I get the decimal points to go away on Android?
You could use the labelFormat property of the LinearAxis and set it to the desired format. For example to make it display the float values without any trailing zeros you can use the "%.0f" format:
<chart:LineSeries.verticalAxis>
<chart:LinearAxis android:labelFormat="%.0f"/>
</chart:LineSeries.verticalAxis>
It is worth mentioning that you can use the dedicated NativeScript UI forums where you can find answers to many questions regarding all of the components of the nativescript-telerik-ui-pro plugin. You can also take advantage of the dedicated paid support ticketing system which provides answers no longer than 24 hours, more information can be found here.

Google Apps Script User Interface

Well, I've been reading the documentation and I believe that I'm calling functions and passing parameters correctly, but for the life of me I can't get this simple UI code to work.
I'm generating a UI for a Spreadsheet using the following code:
function checkOut() {
var app = buildUI();
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
spreadsheet.show(app);
}
function buildUI() {
var gui = UiApp.createApplication();
gui.setTitle("Check-Out/Check-In");
gui.setStyleAttribute("background", "lavender");
// Absolute panel for setting specific locations for elements
var panel = gui.createAbsolutePanel();
// Equipment ID#s Label
var equipmentIDLabel = gui.createLabel("Equipment ID#s");
equipmentIDLabel.setHorizontalAlignment(UiApp.HorizontalAlignment.CENTER);
equipmentIDLabel.setSize("20px", "125px");
equipmentIDLabel.setStyleAttributes({background: "SteelBlue", color: "white"});
// Add all components to panel
panel.add(equipmentIDLabel, 10, 0);
gui.add(panel);
return gui;
}
function getUIdata(eventInfo) {
// I know how to get the data from each element based on ID
}
It generates the Absolute Panel correctly when checkOut() is called, but the EquipmentIDLabel is never added to the panel. I am basing the code on the simplistic design I created in the GUI builder (that will be deprecated in a few days, which is why I am writing the code so that I can change it later):
So what exactly is going wrong here? If I can figure out how to add one element, I can infer the rest by looking at the docs. I've never been any good at GUI development!
You could maybe use grid as an interesting alternative... here is an example :
// define styles
var labelStyle = {background: "SteelBlue", color: "white",'textAlign':'center','line-height':'20px','vertical-align':'middle','font-family':"Arial, sans-serif",'fontSize':'10pt'};// define a common label style
var fieldStyle = {background: "white", color: "SteelBlue",'font-family':"Courrier, serif",'fontSize':'11pt'};// define a common label style
function checkOut() {
var app = buildUI();
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
spreadsheet.show(app);
}
function buildUI() {
var gui = UiApp.createApplication();
gui.setTitle("Check-Out/Check-In");
gui.setStyleAttribute("background", "lavender");
var panel = gui.createAbsolutePanel().setStyleAttribute('padding','10px');
var grid = gui.createGrid(4,2).setWidth('300').setCellPadding(10);//define grid size in number of row & cols
var equipmentID = ['equipmentIDLabel','equipmentIDLabel1','equipmentIDLabel2','equipmentIDLabel3'];// define labels in an array of strings
for(var n=0 ;n<equipmentID.length ; n++){;// iterate
var equipmentIDLabel = gui.createLabel(equipmentID[n]).setWidth('125').setStyleAttributes(labelStyle);
var equipmentIDField = gui.createTextBox().setText('Enter value here').setName(equipmentID[n]).setSize("125", "20").setStyleAttributes(fieldStyle);
grid.setWidget(n,0,equipmentIDLabel).setWidget(n,1,equipmentIDField);
}
gui.add(panel.add(grid));
return gui;
}
It looks like the absolute panel offset method is a little capricious and take control of your positioning, in my tests I have been able to position panels that are visible in the following way:
panel.add(equipmentIDLabel);
panel.add(equipmentIDField,150,0);
panel.add(otherLabel);
panel.add(otherField, 150, 20);
Try it out with trial and error, you may get the UI you need, if not I would move to an alternate layout, verticalPanel is a little better behaved and of course you can use forms as well.
Another small bug is that you inverted the length and hight in equipmentIDLabel.setSize("20px", "125px");
Let me know if I can be of more assitance
The specific problem in your code is the following line :
// Add all components to panel
panel.add(equipmentIDLabel, 10, 0);
Simply change it to : panel.add(equipmentIDLabel);
..and you will see the field (at position 0,0).
As patt0 observes, you can then add OTHER components and use positioning. It seems to be a limitation of adding the first field to an absolutePanel.
Of course, the Google Script gui is now deprecated (since December 2014) but I was interested to try your code and see that it still basically executes (as at Feb 2016).

styled maps with Subgurim Google Maps

It is possible to create a styled map with Subgurim Google Map control?
Here the code in according to Google Api V3.
var styles = [{
featureType: "all",
elementType: "all",
stylers: [
{ saturation: -100 }
]
}];
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var mapType = new google.maps.StyledMapType(styles);
map.mapTypes.set("mymap", mapType);
map.setMapTypeId("mymap");
I'm one of the developers of Subgurim Maps and this feature will be available in our next version, hopefully before the end of the month. As soon as we have it I'll inform you through this question.

Dojo Charting not able to add axis

http://jsfiddle.net/Jn4tT/
var data= [ {"a":2, "b":5,"c":3 },
{"a":5, "b":15,"c":7 },
{"a":1, "b":5,"c":7 } ];
chart1.addAxis("a");
chart1.addAxis("b");
chart1.addAxis("c");
chart1.addSeries("min", {data: data[0]}, { fill: "blue" });
chart1.addSeries("max", {data: data[1] }, { fill: "blue" });
chart1.addSeries("Answered", {data: data[2]}, { fill: "blue" });
var tip = new Tooltip(chart1, "default", {
text: function(o){
console.log(o); //no axis to the current data point
}
});
chart1.render();
I can get the chart to render if I remove the addAxis above, but no matter how I add axis, on a spider type chart, it throws a "can't find axis" error.
Without the axis, it doesn't look like I can set custom tooltips (only want to show the data point, not the series and axis title). And it doesn't look like I have control of the axis labels, fonts, maxlabelsize, etc.
This may be added as a feature in future versions of dojo, but currently after a lot of fighting with it. I cracked open the library and added custom code to handle this and a lot of other things. Basically, just opening the spider.js and common.js files used in generating the spider diagrams. Was able to wrap the labels in my own class's. And also inserted a title attribute for each with the desired label. Using an external tooltip library, I now have a lot of control over the tooltips in spider diagrams.

Resources