Highmaps won't display my GeoJSON lake layer - highcharts

I don't succeed in adding a final layer to my Highmaps. I have already the ground map and some additional layers. But the lake layer does not succeed to be displayed. Why is that? It does load into QGIS correctly.
Truth is, by the way, that I haven't understood the difference between calling a GeoJSON file like this (which works for my additional layers):
type: 'mapline',
data: Highcharts.geojson(Highcharts.maps['lakes'], 'mapline'),
or like this (which works for the ground layer):
mapData: Highcharts.maps['lakes'],
data : data,
But not sure if this is relevant here. It doesn't work the one or the other way. Here is a fiddle.
Thanks for any hints.

The problem is caused by one of the geometry which has null value:
{
"type": "Feature",
"geometry": null,
"properties": {
"OBJECTID": 13,
"NAME": "Lake St. Martin",
"Shape_Leng": 1.1857234063,
"Shape_Area": 0.0450760801303
}
}
After removing the incorrect item everything works as it should. As to your second question: please also check chart.map property: https://api.highcharts.com/highmaps/chart.map and a precise description here: https://www.highcharts.com/forum/viewtopic.php?t=39602
Live demo: https://jsfiddle.net/BlackLabel/ga396zwo/
Docs: https://www.highcharts.com/docs/maps/custom-geojson-maps
API Reference:
https://api.highcharts.com/class-reference/Highcharts#.geojson
https://api.highcharts.com/highmaps/series.mapline.mapData
https://api.highcharts.com/highmaps/series.mapline.data

Related

Onchange update second subcomponent

I have a file that is used to store all my colour choice, I bring the colour choices that I need into a part file using the Subcomponents (Supersedings)
{
"internalId": "externalCubbyCoverColourRack",
"componentId": "racksystems_test:sub_mfccolours",
"numberInPartList": "0",
"active": "version=='Rack'",
"supersedings": [
{
"type": "parameter",
"key": "cubbyCoverColourRack"
}
]
}, {
"internalId": "externalCubbyColourRack",
"componentId": "racksystems_test:sub_mfccolours",
"numberInPartList": "0",
"active": "version=='Rack'",
"supersedings": [
{
"type": "parameter",
"key": "cubbyColourRack"
}
]
},
I have 2 colours that I bring in that are a Main Colour and a Cover Colour, when the main colour is selected it changes the Main Colour and I want it to change the Cover Colour too but if you change the Cover Colour only the cover colour changes. Is this possible to do with a KEY that's used from Subcomponents?
Normally, it is recommended to use parameter onValueChange script. However, this is intended to work in a scope of a single component.
From your code, I think it should be possible to supersede both of them from a single subComponent instance. Then you can link the two parameters somehow in the sub_mfccolours itself, using parameter onValueChange script.
It is important to know, that every subComponent instance is its own component with its own internal data. If you have a reason to have two subComponents like this, it might help to add assignment "cubbyColourRack": "cubbyColourRack" to the externalCubbyCoverColourRack subComponent.

Slack Section Block: Markdown Preformatted Overflow Issue with long strings

When using the Lego... I mean Block Kit builder, I need to send some pre-formatted data using markdown's "```" syntax, the problem is when it encounters a long un-spaced strings (such as a URL) the format breaks when displaying on slack. This is isolated to the block kit builder as sending the message through the app/web app shows up fine.
I tried using the verbatim property, however that did not work.
First block displays the error, second block displays correctly due to spaces being present and no long-words
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "```I_love_oat_cake_croissant_jujubes_tiramisu_pudding_pastry_sugar_plum_I_love._Apple_pie_powder_bear_claw_croissant_candy_muffin_gummi_bears.```"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "```I love oat cake croissant jujubes tiramisu pudding pastry sugar plum I love. Apple pie powder bear claw croissant candy muffin gummi bears.```"
}
}
]
I expected it to mimic what a user's input would display when entering data on the app, which is breaking on long words when necessary, but instead the block is getting shifted off to the left and cutting off some of the data.
Here is an example in both the builder and the application
Currently as of 4/15: This is a known bug so all I can do is wait. They do not offer a public facing site that lists known issues like this, but I have emailed them to track the bug and hopefully if it gets fixed soon I will update this answer.

How to create a composite caption on Neo4j Grass style file?

For example,
"node.Person": {
"color": "#FF756E",
"border-color": "#E06760",
"text-color-internal": "#FFFFFF",
"caption": "{name}"
}
I want the "Person" to be displayed as the label of the node, and "name" and "age" to be displayed as the attributes of the node. Currently, only 'name' is displayed as the caption.
How to change the code above?
EDITED:
Neo4j people, how did you generate the graphs in the book? Thank you. This is one example below.
You can do it by editing the styles. Do this by typing ":style" to the neo browser UI, copy-paste the styles to text editor and just add the fields to the caption in curly brackets e.g.
"node.Person": {
"defaultCaption": "<id>",
"diameter": "50px",
"color": "#A5ABB6",
"border-color": "#9AA1AC",
"text-color-internal": "#FFFFFF",
"caption": "{name} {age}"
}
Would result in showing Person entities with name and age on them.
As I said in the comments of my answer its not possible. My anwser is as close as you can get. "node.MESSAGE": { "caption":"Message name:{NAME}" }. You can only write directly onto the node. I recommend to use different colours for different labels

OL3 and geoserver print module with OSM as background layer

I have an application built in OL3 and geoserver. I am using bootstrap and jQuery in my application.
I am trying to print the maps in pdf. I have OSM as a base layer in my application and other layers come from my local geoserver.
Now I have a situation where I need to print my map in pdf(with all the visible layers and OSM layer).
I have installed printing plugin in my geoserver and it works fine I have tested my printing module with the following codes:
http://localhost:8080/geoserver/pdf/print.pdf?spec={
"layout":"A4 portrait",
"srs":"EPSG:4326",
"units":"degrees",
"dpi":300,
"outputFilename": "map",
"mapTitle":"This is the map title",
"layers":[
{
"baseURL":"http://localhost:8080/geoserver/genesis/wms",
"opacity":0.5,
"singleTile":false,
"type":"WMS",
"layers":["District_Boundary", "DevelopmentRegions"],
"format":"image/png",
"styles":[]
}
],
"pages":[
{
"center":[84.25,28.1],
"mapTitle":"",
"comment":"",
"scale":4000000,
"rotation":0
}
] }
But the problem is how should I print my OSM layer in this?? I am not using Extjs in my application so I don't want to use that just for my printing functionality.
Can anyone suggest how should I do with just jQuery and bootstrap and plain javascript without Extjs??
Thanks.
You just need to add osm as another layer to your request payload like this
http://localhost:8080/geoserver/pdf/print.pdf?spec={
"layout":"A4 portrait",
"srs":"EPSG:4326",
"units":"degrees",
"dpi":300,
"outputFilename": "map",
"mapTitle":"This is the map title",
"layers":[
{
"baseURL":"http://a.tile.openstreetmap.org",
"maxExtent":[
//your extent of map in the correct projection
],
"tileSize":[
256,
256
],
"extension":"png",
"type":"OSM",
"opacity":1
},{
"baseURL":"http://localhost:8080/geoserver/genesis/wms",
"opacity":0.5,
"singleTile":false,
"type":"WMS",
"layers":["District_Boundary", "DevelopmentRegions"],
"format":"image/png",
"styles":[]
}
],
"pages":[
{
"center":[84.25,28.1],
"mapTitle":"",
"comment":"",
"scale":4000000,
"rotation":0
}
] }
You need to change the extent based on your need
Once you send the request Geoserver will populate the osm tiles and put it on the map
Be aware that you should put the osm layer before other layers in your json string otherwise it will be placed on top of other layers in the printed map.
Geoserver Print plugin works only on geoserver data. In your case, you should handle OSM data as a layer in your geoserver instance. There is no possibility to just "proxy" OSM tiles through geoserver, you have to import OSM data into your database. Please check this article:
http://blog.geoserver.org/2009/01/30/geoserver-and-openstreetmap/
When you are using OL3 (canvas support), you can consider browser-side printing. It is very simple to get image from canvas:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
You can also generate PDF in JavaScript using:
https://github.com/MrRio/jsPDF

Add extra info to tooltip for specific bar in nvd3 multiBarChart

I use django with django-nvd3 to generate some charts. I'am not good in javascript at all.
I have this example (java script was created by django-nvd3)
http://jsfiddle.net/rkorzen/87WVr/2/
I want to add extra info to tooltip (if this extra info exist for my bar).
Data is composed of the blocks:
{"values": [{"y": 19, "x": "Checkpoint 1", "info":"ABDG"},
{"y": 17, "x": "Checkpoint 2"}],
"key": "Very good", "yAxis": "1"
},
in this point I want to ad info "ABDG" to tooltip for bar x="Checkpoint 1" and y=19
But don't have idea how :(
I'am not sure if django-nvd3 have some options for this. So decided to ask about js.
Maybe someone Can help:)
Try using extra dict :
'chartdata': {
'x' : 'your_x_axis data',
'name1': 'Somename',
'y1': 'y_axis_data' ,
'extra1': {
"tooltip": {"y_start": "", "y_end": " cal"},
},
}

Resources