Google map with two Fusion Table layers does not display second layer - google-maps

I have a map that is displaying two fusion table layers. I have styled them both using the styleId attribute to take the styles defined in the Fusion Table UI instead of using the styles attribute when creating the layer in Google maps. From the maps docs, it mentions that you can have up to 5 fusion table layers, with one of them being styled.
Styles can only be applied to a single Fusion Tables layer per map. You may apply up to five styles to that layer.
What I'm not 100% clear on is if this applies to inline styles only, e.g.:
layer1 = new google.maps.FusionTablesLayer({
query: {
from: table1Id
},
styles: [
{markerOptions: {iconName: 'red_blank'}, where: 'age > 50'},
{markerOptions: {iconName: 'grn_blank'}, where: 'age <= 50'}
]
});
layer2 = new google.maps.FusionTablesLayer({
query: {
from: table2Id
},
styles: [ // This won't work because you can only style one table inline
{markerOptions: {iconName: 'red_blank'}, where: 'age > 50'},
{markerOptions: {iconName: 'grn_blank'}, where: 'age <= 50'}
]
});
or if it also applies to styles defined in the fusion table UI:
layer1 = new google.maps.FusionTablesLayer({
query: {
from: table1Id
},
options: {
styleId: 2, // Obtained from the fusion table UI
templateId: 1 // Obtained from the fusion table UI
}
})
layer2 = new google.maps.FusionTablesLayer({
query: {
from: table2Id
},
options: {
styleId: 2, // Obtained from the fusion table UI
templateId: 1 // Obtained from the fusion table UI
}
})
From my reading of the docs, it would seem that it's only the first type that is not allowed on multiple layers.
The styleId way of styling a table is actually not mentioned in the Google Maps docs, but this is the way the embed code generated in Fusion Tables when you "Publish" a map looks like, and it actually works for individual layers.
If I enable both layers (layer1.setMap(map)), only one of the layers gets displayed. If I disable a layer, the other one appears correctly.
Any help will be greatly appreciated.

It works with mixing inline-styles and styleId.
Demo with 5 layers, 4 layers use styleId and 1 layer uses 5 inline-styles , as you see the result is as expected 9 different styled markers: http://jsfiddle.net/doktormolle/Zk2CE/
The problem with your attempt: you are always using the same where-clause in the query(currently there is no where-clause, all rows will be selected).
When you define a where-clause in a style this will apply the style to the selected items, to all other items(that will not be matched by any where-clause in a style) the default-style will be applied(e.g. a red dot for a marker)
The result: when specific rows(items) will be selected by the query of more than 1 layer, only 1 style/styleId may be applied to these items(usually the style set with the last layer that has been added to the map).

Related

Forge viewer display only part of element / node

we implemented a complex filter method to filter the elements of the model. Everything based on IFC. Following an example of a IfcFooting element with 2 sub-elements:
ID IfcType Description
--------------------------------------------------------
1 IfcFooting Base
2 > IfcBuildingElementPart Insulation
3 > IfcBuildingElementPart Reinforced Concrete
The filter method can find IfcFooting elements with special sub-element "Reinforced Concrete". Return value is ID 1 and 3. In the viewer we are using the following method to display only the filter results:
viewer3d.impl.visibilityManager.hide(rootId, model);
$.each(selection, function (k, v) {
viewer3d.impl.visibilityManager.show(v, model);
});
Problem is that calling this method with ID 1, the viewer will display 1, 2 and 3. Is it possible to disable this behaviour? We only need to display the sub-element 3, but it is not possible to ignore ID 1 in filter results... thx!
It's the expected behavior, if the id is not a leaf component but a logical component that owns children, then it's normal that showing/hiding this component will impact all its children.
What you should do is make sure all the ids you collect are leaf components (check that instanceTree.enumNodeChildren(dbId) has no children). And perform the logic on leaf only.
In your case you would filter out dbId 1 because it has children and only show dbId 3.
Here is an example:
function isLeafComponent (dbId) {
var instanceTree = viewer.model.getData().instanceTree
var childCount = 0
instanceTree.enumNodeChildren(dbId, function(childId) {
++childCount
})
return (childCount < 2) // Handles IFC with "Body" child
}

Formatting a text area field in NetSuite to span over 3 columns

I was wondering if anyone knows how I could make text area fields in NetSuite span over the 3 columns.
These fields will have lots of text, so it would be nice to have the whole width of the page for each field.
Help would be much appreciated, thanks
A possible solution is to replace the field group Notes with a tab called Notes and add the text area to the tab instead of to the field group (container property set to ID of tab). A test looks like this (I started with the sample Suitelet from Answer Id: 43586):
Here's the relevant snippet:
var subtab = form.addTab({
id : 'custpage_subtab',
label : 'Subtab'
});
var field = form.addField({
id: 'textfield',
type: serverWidget.FieldType.TEXTAREA,
label: 'Text',
container: 'custpage_subtab'
});
Field groups will always use a common layout, according to my tests. So, if there is one field group with 3 columns, then all field groups will have 3 columns and a field cannot span multiple columns, so the idea behind my solution is to use another element, in this case a tab element to display the field content. The tab label is not displayed because there is only one tab. Hope this helps.
The following worked for me:
var fieldGroup = form.addFieldGroup({
id: 'group_notes',
label: 'Title'
});
var field = form.addField({
id: 'textfield',
type: ui.FieldType.TEXTAREA,
label: 'Notes',
container: 'group_notes'
});
field.updateLayoutType({
layoutType: serverWidget.FieldLayoutType.OUTSIDEBELOW
});
Relevant Netsuite documentation can be found here

More than one conditions in Where clause of Fusion Table Layer ignored in Styles

I am writing with reference to an earlier question of mine, which also had to do with the use of Where clauses for Fusion Table Layer in Google Maps. Link to earlier question. I have noticed that if the Where clause in Styles section has more than one filtering conditions in it, it is ignored altogether. Google Map/Fusion Tables Layers then ends up applying that Style to ALL of the features contained in that Fusion table. You can remove a filtering condition from the Where clause to make it a single filter where clause, and it then works as expected so I am pretty sure that it doesn't like multiple filtering condition in the SAME where clause (or the way I am writing it).
Here is an example that illustrates this behavior:
layer = new google.maps.FusionTablesLayer({
map: map,
options: {
templateId: 2
},
heatmap: { enabled: false },
query: {
select: "geometry",
from: "1D6d93-0iT2zUCw8IvkbpDPYDx2-jA0ZAWXi07mQD",
},
styles: [{
//note multiple filters in the same Where clause.
where: "((SHIFT_ID != 1) AND (SHIFT_ID != 2))",
//you'd expect the following Style option applied to only those map features
//which met above criteria. However, they are applied to ALL map features.
polylineOptions: {
strokeOpacity: 0.70,
strokeColor: "#FFFFFF",
strokeWeight: "5" }
//if Where clause is reduced to just having one filter, it works fine.
//For example, either of the following two work fine by themselves.
//where: "SHIFT_ID != 1" --OR--
//where: "SHIFT_ID != 2" etc.
}]
});
Geocodezip was right; query was invalid.
This is what I have been able to determine re use of queries for Fusion Tables.
Can have multiple fields/filters in one where clause.
Can't use brackets "()" for Boolean logic.
Instead of !=, use NOT EQUAL TO
For NULL values, check equality with '' (empty string).
Field names are case sensitive.
https://developers.google.com/fusiontables/docs/v2/sql-reference

google fusion table select in from another table not working

I am trying to select some rows based on row values from some other table but its not working. I have tried something like this
layer = new google.maps.FusionTablesLayer({
query: {
select: '\'Geocodable address\'',
from: '1m9CwnJrCfWNHCEQQkxqcQBzp-dA-S9KB8vLTpCrv',
where: 'ZCTA5CE10 in (select zip from 1V6aWLW-CEw2hRcPSzom1b9-Op6PS1ZQiyCH3GIRI)'
},
styles: [{
polygonOptions: _defaultStyle
}]
});
layer.setMap(map);
Its ignoring the where clause and drawing all rows on map. How to fix it?

Higstock add all series dynamically

I've a Higstock lineal graph. Sometimes I need to show just one serie, other times I need two or three series to draw.
Obviously, this is an example of adding series dynamically. I put:
$(function() {
var chart = new Highcharts.StockChart({
// ...
series: []
// ...
})
chart.addSeries({name : "Value1",data : value1Data});
chart.addSeries({name : "Value2",data : value2Data});
chart.addSeries({name : "Value3",data : value3Data});
But not working, the chart needs to have at least one serie with data values in "series" node, not allowing an empty series node, like I put before.
I need to add all my series dynamically.
Anyone can help me? Thanks.
Example: http://jsfiddle.net/8aP69/1/
FYI: The graph only draws the navigation bar.
After many little test, a man that I loved him give me the solution.
I need to set initial series node like that:
series: [{ name: "Serie1", data : [null]}] // first serie has to be null
And after that, adding data point for first serie.
chart.series[0].setData(data1); // adding his data here