Is it possible to move SymbolLayer icon as per the updated location points? - mapbox-android

I wants to move SymbolLayer icon on the map layer as per the position change, move like as a marker. In the latest Mapbox update, MarkerView and MarkerViewOptions is deprecated. So I want to move the SymbolLayer icon.
Please help me to make it work.
Thanks

There are several ways you can do this and it's kinda' dependent on what type of source + layer you're going to use. First read https://docs.mapbox.com/android/java/overview/geojson/#geojson-updates
https://docs.mapbox.com/android/maps/examples/animate-marker-position/
If you're using a GeoJsonSource, you'll set new geojson on the source when you know the new coordinate(s) that you want the SymbolLayer icon to move to https://github.com/mapbox/mapbox-android-demo/search?q=setGeoJson. Make sure you're updating the GeoJsonSource that the SymbolLayer is using.
There's the annotation plugin, which handles lots of the layer/source boilerplate code you'd have to ordinarily write: https://docs.mapbox.com/android/plugins/overview/annotation/. symbol.setLatLng(); and symbolManager.update(); will be helpful. See https://github.com/mapbox/mapbox-plugins-android/blob/master/app/src/main/java/com/mapbox/mapboxsdk/plugins/testapp/activity/annotation/SymbolActivity.java and https://docs.mapbox.com/android/plugins/examples/symbol-listener/

Related

AutoCAD script: Find drawing position

Forgive my ignorance. I'm a web developer tasked with integrating an app with AutoCAD and I have no experience with the software or CAD files in general.
I have hooked it up to A360 and the Forge APIs and now I'm looking to modify drawings using scripts uploaded to the Design Automation API. What I need to do is add part numbers and some other data generated by the app to the drawings. I have the following script I've managed to get working which is a very basic version of what I need to achieve.
; Add a label to a drawing
-mtext 0,300 400,310 App data
Tag No: P1234567
Created: 29/09/16
; Define Attribute
-attdef
i
P1234567
tag
-
0,200
10
0
; end
This script adds an MTEXT and ATTDEF to a drawing with a bit of basic data. What I want to do is position the labels at the bottom right of the drawing.
Is it possible to get the position of the drawing from somewhere so the script can figure out where the bottom right is? Ideally it needs to work no matter where the creator has positioned the drawing.
Bonus points: I'd also like to put this data into the drawing metadata somehow, would this be beneficial and how would be the best way to achieve this?
Thanks in advance.
If you would still like to do it in Modelspace, and you can control the drawings, it is possible to achieve this by finding the position of blocks with specific names.
Example: http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-a-block-and-get-it-s-insertion-point/m-p/3309261#M302014

osx editor similar to OmniGraffle

id like to make an editor similar to OmniGraffle. Basic functionality:
1) add objects
2) live resize objects
3) per object context menu
4) ability to connect objects with a curve so dragging one object would constantly redraw connected curve
Is there any open source libs for that? If not, how do i make my own? Each object should be represented by a layer or it has to be drawn using CG or maybe i'll need display link. Please advice
To start with, you can refer the Sketch example from Apple Developer Examples.With Mac OS 10.6.x, it is available in the folder /Developer/Examples
This example has basic events handling like drawing on mouse Down etc .

Manually upgrading Three.js JSON geometry files from r42 to r55

I have some JSON files that define geometries, as required by r42 of Three.js's JSONLoader class. The files are version 2 of the format.
Is it feasible to manually update these files between versions?
The first obvious difference is that the file is no longer JavaScript, but actual JSON. This was easy to correct for. However the new format has a metadata section, and thirty minutes of experimentation with is isn't getting me anywhere.
I'm seeing problems because the Geometry object's material properties has an empty materials array. The resulting geometry has multiple parts with different materials, as seen in r42.
Does anyone know how I might manually tweak these .json files to work with r55?
I have no complete knowledge how the internals of the format have changed, but here's a couple of hints:
If you have the source object, the best way would be to re-export/convert. There should now also be more converters and exporters to use if your source format is obscure. If the source is unknown, some Googling might be worth it.
metadata section doesn't matter, it isn't used for anything in the loader.
There is no more Geometry.materials. Instead, JSONLoader's callback returns the loaded materials as a separate parameter to the callback. See Migration Guide (r52->r53) for more on that. In fact, the loader interface has changed also in r46.
git log of some example model files (searching for changes there could be your way forward if you really need to manually migrate) suggests that there might be e.g. UV flipping which would be difficult to fix manually but could be worked around in code. But first you'd need to get something to display on screen.
Try dragging the file into the editor, then do File/Export Geometry.
Here is a fix for drag and drop into the editor. Add this code before the drop event in index.html. I tested this in Chrome ( 24.0.1312.56 ), Safari and Firefox in OSX.
document.addEventListener("dragover", function(e) {
e.preventDefault();
});
#mrdoob's answer worked after a few patches to the editor (here and here.)
However it's worth noting that upgrading the files by hand in a text editor is possible, especially if you don't have any UV coords.
Earlier versions did not use JSON -- they were JavaScript files. The conversion is straightforward.
You can either ignore the metadata section, or else port it from the comments into an object.
If you do have UV coords, then they must be mapped differently (I believe an axis is flipped)

How to add a colored filter effect on an image?

I am building an Eclipse RCP application, based on eclipse 3.5.
I'd like to modify an image at runtime. The image is loaded and will be used as an icon, but depending on the situation, I'd like to add a filter on the image to give it a red or orange color, depending on some user-configured value.
It's the image transformation that I'm interested in. I already know how to get the image and ask a component to display it.
Has anybody done that? Thanks for your help :)
There are possibly many choices for doing just that, you can use ImageIO to load an image as BufferedImage and then get the Graphics2D and modify it as you wish. When you are finished modifying you can reaasign the newly created image back into your component which holds the original image and thats it.
You can of course look for some libraries to allow you easier image manipulation, maybe jmagick or something similar.
You can use DecoratingLabelProvider with a suitable ILabelDecorator. See also FAQ What is a label decorator?

How can I add a MyDrawPanel to a program while adding other objects as well?

I am attempting to make a simple game, and I have loaded an image onto a myDrawPanel, which is on the JFrame, successfully. However, I also want to add other things to my GUI, such as buttons, etc. I cannot do this, however, because when I add the myDrawPanel to a JPanel, all I get is a small square in the top center of the window. This is proving to be greatly limiting, and I was wondering if there is an alternative "JObject" that I can add the myDrawPanel to in order to allow for the customization of my GUI. Thanks in advance, and Merry Christmas!
A JPanel (or sub-class) generally obtains its size from the components it contains. If no components are in it, it will be small.
One way to fix that is to call setPreferredSize(Dimension) on the customized panel.
p1.setPreferredSize(new Dimention(1100,800));

Resources