Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Taylor Broad
    @BossOfGames
    @nvkelso thanks for the heads up
    sdudarenko
    @sdudarenko
    Hi everyone) I have a question
    How to show an overlay between lines if this lines are parts of one layer?
    This layer is “FeatureCollection” where features = Array([LineString]).
    How to paint the overlay using another color or change opacity according to opacity of lines?
    If it is possible to use scene.yaml in this case?
    Taylor Broad
    @BossOfGames
    @sdudarenko can you give a link to an illustration on what you're trying to accomplish? I would think either the filtering example or potentially using a function to check a property in your datasource would help
    sdudarenko
    @sdudarenko
    Hi, there are illustrations:
    https://drive.google.com/open?id=1kiKRrJCD_SKzJ_A7bpH7mtipGOBkbxwv
    https://drive.google.com/open?id=1r74mXr2MMQXjzvkxrZPAf41hlfu3rkNX
    Orange line is in the middle of green line, which has its width defined in meters. The intersections of green line with itself are dark green.
    vilmos
    @vilinet_gitlab
    Hiya,
    Is there any way in tangram to render label texts? I want to see all text, independently of the actual zoom level.
    Cheers
    Peter Richardson
    @meetar
    @sdudarenko If you'd like to use translucent colors, you must change the alpha value of your color (the default is 1.0), and then set a blend mode to something besides the default opaque. https://tangrams.readthedocs.io/en/latest/Tutorials/custom-styles/#transparency-with-blend-modes
    Peter Richardson
    @meetar
    @vilinet_gitlab There are two ways to render labels – one is using the text draw style, which creates a standalone label element (https://tangrams.readthedocs.io/en/latest/Overviews/Styles-Overview/#text_1) – the other looks the same, but is a child of a points draw style - this "attaches" a label to a drawn point such as a sprite or icon (https://tangrams.readthedocs.io/en/latest/Syntax-Reference/draw/#text)
    @vilinet_gitlab Regarding zoom levels – you will only be able to draw labels which exist in the current visible zoom level. You can adjust this somewhat with the zoom_offset parameter – it has not been documented yet, but there is an overview in the 0.17 release notes: https://github.com/tangrams/tangram/releases/tag/v0.17.0
    sdudarenko
    @sdudarenko
    @meetar thank you!
    sdudarenko
    @sdudarenko
    Hi,
    I made a demonstration of my question:
    https://codesandbox.io/embed/tangramjs-self-intersection-66z5w
    The line is transparent(alpha 50%, to see it you need to zoom out the part related to streets which are presented on the map).
    But the line will merge on intersections, not overlay on itself(I've added outline to clearly see it).
    Is it possible to make that all intersections of lines with themselves would be showed up in different color by using scene.yaml(as it's presented on screenshot attached below)?
    https://drive.google.com/open?id=1kiKRrJCD_SKzJ_A7bpH7mtipGOBkbxwv
    Brett Camper
    @bcamper
    @sdudarenko I think the translucent blend mode will doo what you want (it's used for 3d buildings where overlapping walls mask each other similar to what you describe)
    sdudarenko
    @sdudarenko
    @bcamper thank you!
    vilmos
    @vilinet_gitlab

    Hi all!
    Is there way to hide/show a layer or style in tangram in C++, so just toggling visibility?
    If there is no way to do it right now, what would be the best way to add it?

    right now i just tried to ignore styles at rendering that set to non-visible, but sometimes it causes glithces as the main "cached" texture is not updated well.

    yanickv
    @yanickv
    Is there a way of determining if a given GPS position is on water?
    ivan korol
    @ivanking87
    Help me please!!! How select building on map by click in android SDK?
    vilmos
    @vilinet_gitlab
    As far as i know there is no function like that in tangram-es. You need to take care of object selection.
    You need to go through all your objects and find the object that overlaps your x,y touch position.
    Then pass the found object's geojson into your specific "highlight layer" in tangram.
    ivan korol
    @ivanking87

    @vilinet_gitlab thank you for your answer, but please be a little more specific, I'm new to tangram-es.
    If I understand correctly I need to divide the task into two parts

    1. You need to go through all your objects and find the object that overlaps your x,y touch position.
    2. Then pass the found objects geojson into your specific "highlight layer" in tangram.

    I beg You, can you give some short example of how this can be done?

    vilmos
    @vilinet_gitlab

    @ivanking87
    Soo First i am sure there is a library for manage geospatial verticies be able to search among them but i am not really into these stuffs(or libraries you can use to search in a geojson for specific)
    -1, Add a new layer to the yaml like:

        selected_layer:
          filter: { layer: selected_layer}
          draw:
            polygons:
              color: [0.0, 0.5, 0.5, 0.3]
              collide: false
              order: 2006
              cap: round
            lines:
              color: [0.9, 0.2, 0.2, 0.7]
              collide: false
              width: 2px
              order: 2007
              cap: round
            points:
              color: [0.0, 0.9, 0.2, 0.7]
              collide: false
              size: 4px
              order: 2020

    0, add this line to your code after you load the scene file:
    MapData selectedLayerSource= mapController.addDataLayer("selected_layer");
    you should able to reach it anywhere from your class, so make it into a instance field.
    This selectedLayerSource is now the source of your selected layer, if you insert any geojson, it will be rendered on your map.
    1, You need to handle your geojson/geospatial data, wont work if you just pass it from a source url/file;
    2, Lets assume you work withe the geojson. in this case you can use the JSONArray class to search among the json Or parse the geojson into a normal java obj( thats much faster to work with usually.)
    3,Once you have an object, you can easily search among these( https://stackoverflow.com/questions/27804619/search-element-in-a-jsonarray-in-java )
    4, Then you override the onSingleTapConfirmed in your activity where tangram is used.(if you use the demo one it should be there). In this method you get the x,y parameters(langitude, lattitude), so you can find your object in your array.

    1. Then when you found your feature you need and just pass the geojson of the feature into your layer: selectedLayerSource.setGeoJson(myFeatureGeoJson);
    2. and now your object is "highlighted"
    ivan korol
    @ivanking87
    @vilinet_gitlab Thanks you best man!!!
    ivan korol
    @ivanking87
    @vilinet_gitlab One more question if I may...
    sources:
    osm:
    type: TopoJSON
    url: https://vector.mapzen.com/osm/all/{z}/{x}/{y}.topojson?api_key=vector-tiles-HqUVidw
    max_zoom: 16
    TopoJSON can I use? or do I need to convert TopoJSON to GeoJSON first?
    tomerlevi444
    @tomerlevi444
    Hi,
    I can't sign up at https://www.nextzen.org/ to get an API KEY.
    how can this be resolved?
    Varun
    @tallytalwar
    @iandees can you check this please?
    ^
    ivan korol
    @ivanking87
    Hi, please tell me how I can insert a 3D object on the map? In what files can such functionality be added? If there are no ready solutions can at least someone tell me the sequence of implementation of these steps?
    Nathaniel V. KELSO
    @nvkelso
    @tomerlevi444 please use the first link on that page, which lands you on https://developers.nextzen.org/. You'll need a Github account to login.
    Hsieh Chin Fan
    @typebrook
    Also, a real example may helps
    ivan korol
    @ivanking87
    @typebrook I want add not 3d building. I want add other 3d object from .obj file
    Brett Camper
    @bcamper
    @ivanking87 unfortunately that is not supported currently, @matteblair @tallytalwar might have advice
    Hsieh Chin Fan
    @typebrook
    @ivanking87 I see. Sorry, my bad...
    Matt Blair
    @matteblair
    Hi @ivanking87. Tangram ES doesn't currently provide a way to render models from .obj files. We have a feature in development to allow a client application (your code) to do custom OpenGL rendering within the map. In this case you would still need to transform your .obj file into OpenGL commands for rendering.
    This feature is in a branch called CustomRenderer: https://github.com/tangrams/tangram-es/tree/CustomRenderer
    ivan korol
    @ivanking87
    @matteblair thank you for your answer, tell me please how i can convert the model to the coordinates of the map? in the Render function. I have a model currently loading without considering the camera position and space
    ivan korol
    @ivanking87
    And maybe you can tell me who could implement the function of adding 3D obj files to the map for a little money (~$50)
    Gabe O'Leary
    @goleary

    Hello All,
    I have a web application that uses Tangram. It switches sources for a layer based on the zoom level. I need to run some updates to my UI after the switch, querying for the newly visible features. After looking through the Docs, the only 2 relevant events that I could find to be subscribed to were load & view_complete. load seems to only fire once at the beginning of the page load & view_complete would fire before my source had switched (not helpful). I looked into the Tangram source and found several other events being triggered (including update & move) from scene.js. It seems like update is triggered on an update to the scene config in place of load. I'm now using this event and able to accomplish what I mentioned above.

    How come these events are not documented?
    Do I run the risk of any unintended consequences by using them?

    Thanks!

    Brett Camper
    @bcamper
    Hi @goleary - you can reliably use the update (and load) events. They should be documented, that's just oversight/lag in documentation (update was a later addition/extension of load). The move event is used for internal synchronization with Leaflet. It can also probably be safely documented as a public interface, but we may want to double-check a couple things first there.
    Peter Richardson
    @meetar
    @bcamper When was update added? I'm having trouble locating it in the releases … I'm definitely a few behind, I've just started on 0.17 :sweat_smile:
    Gabe O'Leary
    @goleary
    thanks for the info @bcamper - another question for you: Is there any way to easily move the view to center on a specific polygon feature? After using queryFeatures(...) I want to move the camera view over one of the features. The only thing I've thought of so far is using something like mapshaper to generate lat/lng props for the feature and then reading the props and moving the camera that way. Is there any way to do this in tangram without modifying the data source?
    Brett Camper
    @bcamper
    @goleary - there's no way to have Tangram automatically center on a given feature, but if you call scene.queryFeatures({ geometry: true }), you'll get back a GeoJSON feature that you could use for this purpose. If you want a centroid, you could use something like turfjs (or derive it yourself). Or, it could be easier to just do it in the data source as you suggest. One thing to note with the geometry: true method is that polygon and line features can get split across tiles, and thus will really be two (or more) distinct "features" from Tangram's perspective.
    Gabe O'Leary
    @goleary
    I see. That feature splitting behavior does complicate my scenario slightly. Thanks!
    ROCFER
    @RochiGH
    how to get the view complete map status in tangram es ? get the signal that map view is all drawn on the screen ?
    bool Map::update(float _dt) {} return bool tilesLoading = impl->tileManager.hasLoadingTiles(); always true so viewComplete can't be used
    Varun
    @tallytalwar
    @RochiGH have you tried https://github.com/tangrams/tangram-es/blob/5f831b6e479dd4debbccf1e8472fe6844eed3b0a/core/include/tangram/map.h#L147?
    If its not working we could have introduced a bug somewhere, can you file an issue if this is not working?
    But the idea of MapStage::viewComplete is to notify if everything is drawn and nothing more is left to be drawn in the current view, so say one can take a screenshot of the map at this point.
    ROCFER
    @RochiGH
    Yes let
    yes let me check again on Monday morning and I will come back with an update of the status because I need to check that I am aligned with the Head Repo. Tks for now. This is what I need anyway , just let it working! Tks for now text you Monday! Tks! Super tks!
    ROCFER
    @RochiGH
    ok I checked and is all ok ! tks , but now I. have another issue : usign a vec mbtile RAM usage. seems to go to high zooming in the map!
    @tallytalwar can you give me some hint about this topic ?