Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Line #7

Open
flopp999 opened this issue Apr 12, 2018 · 14 comments
Open

How to use Line #7

flopp999 opened this issue Apr 12, 2018 · 14 comments

Comments

@flopp999
Copy link

flopp999 commented Apr 12, 2018

I can successfully view data with polygon but not with Line.
How to do that with a line?
Can you help me in the right direction maybe?

@samhatchett
Copy link
Member

So you should be able to define your LineString property in your geojson...


{ "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "line_name": "myLine123",
        ...
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
            [ -105.87799800030689, 33.24399899955506 ],
            [ -105.98500100019538, 33.269000999597324 ],
            ...
        ]
      }
    },
...

And then the other important piece is to enter the two keys that will be joined.

GeoJSON ID Path is the json path (for the above example, it would be properties.line_name)

Series GeoID Tag is the location-identifying tag that you've grouped by (in the query panel)

screen shot 2018-04-12 at 2 15 47 pm

So those three important things: the property must exist in the geojson as a LineString, enter the json path to the identifier, and enter the tag you've grouped by.

@flopp999 flopp999 changed the title How to use Line and Point How to use Line Apr 12, 2018
@flopp999
Copy link
Author

I am able to get it to work.
I have tried to zoom in and zoom out, I cannot see any line anywhere.

this is my line.json

line(
{
"type": "FeatureCollection",
"features": [
	{
	"type": "Feature","properties":
		{
		"line_name": "myLine123"
		},
		"geometry":
			{
			"type": "LineString",
			"coordinates": [ [ -96.1802918, 40.222222 ],[ -96.1802918, 41.222222 ]]
			}
	}
]
}
)

this is my setup in Grafana
geoloop
geoloop1

@samhatchett
Copy link
Member

OK, got some info. It turns out that there may be an issue with displaying fixed colors.

If you set the "Visualization Color Options" to "measurement", the line should magically appear. If this does happen, then that would confirm the issue. Please let me know.

@flopp999
Copy link
Author

I tried with measurement instead of fixed, still no line

@samhatchett
Copy link
Member

If you could look at the javascript console output from your browser, that would probably help - any error messages or strange logs?

https://webmasters.stackexchange.com/questions/8525/how-do-i-open-the-javascript-console-in-different-browsers

@flopp999
Copy link
Author

flopp999 commented Apr 13, 2018

It says:
mapbox-gl.js:417 Error: The layer 'f-1523636320000' does not exist in the map's style and cannot be styled.
at t.setPaintProperty (mapbox-gl.js:305)
at e.setPaintProperty (mapbox-gl.js:391)
at GeoLoop.stepFrame (geoloop.js:230)
at eval (geoloop.js:199)

f-xxxxxxxxxxxxxxxxxx is counting upwards, it is epoch time i guess

@flopp999
Copy link
Author

at the top is says
mapbox-gl.js:417 Error: layers.f-1523636520000.paint.line-opacity: 76 is greater than the maximum value 1
at Function.module.exports.emitErrors (mapbox-gl.js:325)
at t._validate (mapbox-gl.js:305)
at t.addLayer (mapbox-gl.js:305)
at e.addLayer (mapbox-gl.js:391)
at eval (geoloop.js:175)
at Array.forEach ()
at GeoLoop.createFramesSafely (geoloop.js:131)
at eval (geoloop.js:77)

@flopp999
Copy link
Author

My mistake, I think I have played with this opacity number, let me change that

@samhatchett
Copy link
Member

also worth noting - I made some more commits after the 1.1 tag, which might fix this issue. I cannot reproduce the issue using the current repository version.

I will tag the 1.1.1 release and put that through to the grafana-plugin list.

@flopp999
Copy link
Author

I am using 1.1.1, installed it a few seconds ago, using this command
grafana-cli plugins install citilogics-geoloop-panel

@samhatchett
Copy link
Member

right, just saw that the plugin directory has 1.1.1 - however, there was a minor patch after that related to maps failing to render. You could wait for the directory to be updated, or clone the plugin directly from this repo instead of using the grafana-cli. As for a workaround, try the grafana refresh button?

@flopp999
Copy link
Author

I used git in my Debian, so now have the latest version, still not possible to make line. It says
Error: The layer 'f-1523638190000' does not exist in the map's style and cannot be styled.

@flopp999
Copy link
Author

flopp999 commented Apr 13, 2018

at the top in java console
Uncaught TypeError: Cannot read property 'forEach' of undefined
at GeoLoopCtrl.updateGeoDataFeatures (geoloop_ctrl.js:293)
at Object.success (geoloop_ctrl.js:222)
at u (jquery.js:3317)
at Object.fireWith [as resolveWith] (jquery.js:3447)
at r (jquery.js:9272)
at HTMLScriptElement.n (jquery.js:9639)
at HTMLScriptElement.dispatch (jquery.js:5206)
at HTMLScriptElement.g.handle (jquery.js:5014)

@flopp999
Copy link
Author

flopp999 commented Apr 13, 2018

Thank you for all your help, you are quick to reply 👍
No rush for this, I am only checking what we can use to present data in different ways.
Will try with Point instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants