-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added command line utility to test out the library interface #12
Conversation
Add a command line utility to test out the library interface Added include directives to camera_options.go to allow it to find c/c++ libraries.
img = ss.Snapshot(&FBounds, size) | ||
|
||
case CmdTile: | ||
img = mbgl.SnapshotTile(ss, FTile, size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ear7h I think instead of size, which is difficult to understand what is going on here. Since you are setting the X, Y for width and height. I think instead you should just take a width
and height
parameter of type uint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, these should return errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors need to be implemented on the C side. #1 is tracking this and I currently put in a suggestion for this using macros
@ear7h I only have one comment. Not much of any api really which is good. We need to improve the documentation quite a bit. |
I need some help testing this as I get the following errors:
For
|
The second issue is related to #11. Not sure what to do about the style out of date problem |
mbgl/camera_options.go
Outdated
|
||
/* | ||
#cgo CXXFLAGS:-I${SRCDIR}/../mapbox-gl-native/include | ||
#cgo CXXFLAGS:-I${SRCDIR}/../mapbox-gl-native/platform/default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move these to mbgl.go
, I want to keep the compiler directives in one file to easily keep track of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we will need to have these things be on a per OS bases soon. I did this just to get this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is currently split up by OS (see mbgl_darwin.go
and mbgl_linux.go
) although, I haven't tested the bindings on linux.
img = ss.Snapshot(&FBounds, size) | ||
|
||
case CmdTile: | ||
img = mbgl.SnapshotTile(ss, FTile, size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors need to be implemented on the C side. #1 is tracking this and I currently put in a suggestion for this using macros
cmd/snapshot/main.go
Outdated
for i, part := range parts { | ||
switch i { | ||
case 0: | ||
v, err = strconv.ParseUint(strings.TrimSpace(part), 10, 64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be outside of the switch statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add a command line utility to test out the library interface
Added include directives to camera_options.go to allow it to
find c/c++ libraries.