This is a migrated thread and some comments may be shown as answers.

Drawing lines on tile layer or marker layer

5 Answers 201 Views
Map
This is a migrated thread and some comments may be shown as answers.
Wei Shiong
Top achievements
Rank 1
Wei Shiong asked on 06 Feb 2016, 09:36 AM

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

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 10 Feb 2016, 07:59 AM
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!
 
0
Wei Shiong
Top achievements
Rank 1
answered on 11 Feb 2016, 06:13 AM

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

0
T. Tsonev
Telerik team
answered on 15 Feb 2016, 03:09 PM
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!
 
Bhumi
Top achievements
Rank 1
commented on 09 Jun 2021, 03:55 PM

Hi,
I am facing the same issue. In my code the order of layer is Tile, Shape and Markers. Is that correct order?

Regards,
Bhumi
Georgi Denchev
Telerik team
commented on 11 Jun 2021, 09:11 AM

Hi, Bhumi,

Yes, that would be the correct order. Could you share an example in dojo where the problem is reproduced so I can examine it locally?

Bhumi
Top achievements
Rank 1
commented on 11 Jun 2021, 02:42 PM

Hi Georgi,

I have updated sample code https://dojo.telerik.com/oyilErAR. I want to display arrow on the path end where marker move to next marker.

Regards,
Bhumi
Georgi Denchev
Telerik team
commented on 15 Jun 2021, 11:26 AM

Hi, Bhumi,

There is no built-in shape for an arrow, basically you'll have to draw it on your own using the Canvas and lines.

Here is one example using the provided dojo:

https://dojo.telerik.com/@gdenchev/uPenURuz 

0
Wei Shiong
Top achievements
Rank 1
answered on 15 Feb 2016, 04:21 PM

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

0
T. Tsonev
Telerik team
answered on 17 Feb 2016, 04:54 PM
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!
 
Tags
Map
Asked by
Wei Shiong
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Wei Shiong
Top achievements
Rank 1
Share this question
or