The application of the image is simple: when I press the rotate button, I set the background image of the marker with the image below the button that it contained in a canvas. But I have a problem. I want the image of the vertical line (contained in the canvas) to occupy the entire map at the top. Doesn't it take up everything because it is limited by the size of the canvas? How do I get the image of the vertical line inside the canvas (which is bigger) to cover the entire map screen?
Why not draw a line string on the map (as @SteveJG previously suggested) , after calculating the start / end coordinates of the line string based upon the angle of rotation and the centre point of the marker ? The line string can be as long as you like.
Sure, I do that about the canvas and imagesprite, but the size of the image contained in the canvas is limited by the size of the canvas.
For example, if the canvas is 50px high and the image is 100px high, the image that I am going to set to markup will be 50px high and not 100px as I want.
The idea is to use the first case that you tell me. I can try the second case too, although it doesn't convince me.
With much help from @SteveJG, for which I am most grateful, I have developed a working example, based upon what I suggested. Using a marker as the start point, a touch anywhere on the map will draw a linestring on that bearing. This could be further programmed with a list of coordinates. No need for a canvas. The example is not perfect, and will generate errors if there is not enough "room" on the maptile/s for the linestring to be drawn.
Is it possible to make an image grow beyond the size of the canvas?
Unfortunately, it is not possible.
What you can do is place a canvas inside a centred vertical or horizontal arrangement, then set the canvas dimensions to numbers larger than your arrangement. This then gives an impression of image sprites being larger than the canvas (even though they are not!). However, this will probably not help you with what you are trying to achieve.
Hi Tim! I must admit you were right about drawing a line with the linestring. Something like that I was looking for! Based on what you happened to me, I'm going to try to get to what I want.
Any doubt I will surely return, I hope not! haha
I thank you very much for the help and for the time!
@TIMAI2 I am left with one more question about this: Is there a way to generate N linestring dynamically? Either with a button or with some other action? And if there are many linestring, could the application stop working?
I only know that I can create linestring from the block window and statically.
I think I was expressing myself wrong. I give an example: For each click, I generate a new linestring component. It would be like creating for each click, an independent line on the map.
Next I upload an image. The green arrow indicates the sequence of the steps.
The idea is to generate the amount of linestring components that I want by clicking, but instead of doing it from the block screen, do it with the app running
with a bit of work on the mathematics you could come up with a formula for setting a line based upon the lat/lon of the map centre string and the zoom level of the map
No one can create LineString instances dynamically using Blocks. You can only produce a dynamic Marker (runtime Marker) on the Map component but not a LineString. Tim @TIMAI2 presents a very viable way to display many LineStrings on the Map using LineString components already placed. Place as many LineStrings as you will need on your Canvas; hide them (by setting LineString.Visible to false) and then make them visible when needed. His idea is your solution.
This is the LineString documentation. Unlike Markers, that can produce a runtime Marker; LineStrings are always design time.
Hi @TIMAI2 How are you?
Test your program. I only changed the position of the marker (I placed it in Buenos Aires, Argentina). I only drew the line once and fired an error. Then I made another tap to generate another line and it didn't let me go anymore. I guess the error occurs because both coordinates are negative. The coordinate of -36.69 ... is correct, but the other one is not.
I must be honest with you. I would not know how to solve it. There are too many math accounts that I can't understand, a lot of code that surpasses me.
Besides that, what does that fixed value in R (6371e3) mean? I would love to make it work for the case that fails me, but I have a hard time understanding it.