Drawing lines on tile layer or marker layer

6 posts, 0 answers
  1. Wei Shiong
    Wei Shiong avatar
    11 posts
    Member since:
    Aug 2012

    Posted 06 Feb Link to this post

    Hi,

         I would like to check if there are any means that would allow me to draw lines on the tile layer? I was looking at this example 

    http://docs.telerik.com/kendo-ui/controls/diagrams-and-maps/map/how-to/link-marker-to-location and would need lines to be drawn on top of the tile layer instead of them being drawn over the shape layer.

     Best Regards,

    CH

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 10 Feb Link to this post

    Hi,

    The tile layer is only able to load images. You'll need to overlay with a shape layer to enable free-form drawing.

    I hope this helps.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Wei Shiong
    Wei Shiong avatar
    11 posts
    Member since:
    Aug 2012

    Posted 11 Feb in reply to T. Tsonev Link to this post

    Hi Tsonev,

          I was modifying the script from the link-marker-to-location example by adding a tile layer but noted that the tile layer will always appear over the shape layer, thereby obscuring the drawn line. Is there any example whereby shape layer will appear over the tile layer so that the drawn line will appear on the top most layer? I do not need geojson data on the shape layer.

    Best Regards,

    CH

  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 15 Feb Link to this post

    Hi,

    Please accept my apologies for the delayed response.

    The layers will render in the order they're defined. If you put the tile layer first it should remain below the shape layer.
    You can also specify a zIndex - useful when you're adding layers dynamically for example.

    I hope this helps.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Wei Shiong
    Wei Shiong avatar
    11 posts
    Member since:
    Aug 2012

    Posted 15 Feb in reply to T. Tsonev Link to this post

    Hi Tsonev,

        Thanks for the solution. One question on map.locationToView. I have got a function that is supposed to retrieve the view coordinates whenever a user clicks on the marker. However, I noticed that the return value remains the same after I pan or zoom the map. How would I be able to get the correct pixel coordinates from this function?

     Best Regards,

    Choong How

  7. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 17 Feb Link to this post

    Hello,

    I'll investigate and back to you on the locationToView method. It looks like a bug to me - it should take into account the scroll offset.

    How about using the eventToView method directly? It will extract coordinates from the browser event directly.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready