I am trying to draw a number line in wp8 app but unable to do so
I want to create a line and show numbers on it. Then I would like to have a pointer on it pointing on a number on number line.
How can I do so?
I can point you in the approximate direction.
use a canvas and when drawing a line use Line. A line is s line with no pointers. You can places textblocks nearby.
you then add line, textblocks etc to canvasvas children.
Related
I have a path (which is essentially a line). I am able to draw an arrowhead with the help of marker-end attribute of path. But now I want to make a + sign in the middle of the path. I think for that purpose, marker-mid should be used.
Here is the code and output when I use marker-end.
Here is the code and output when I use marker-mid.
marker-mid specifies the marker type that should be placed for the points in a path that are not the first or last point.
In other words, if you have a path that consists of four points (thus three lines), marker-mid markers will be placed on the middle two points.
There is currently no way to automatically place markers in the middle of a line segment as you wish. You would need to either place an appropriate shape at that point yourself, or split the line into two half-lines.
SVG 2, which is still in development, will likely have this feature, but you can't do it yet.
I have a GMSMutablePath object containing coordinates that I display visually on the screen with a GMSPolyLine. I want the user to be able to tap on a line segment (spanning two coordinates) and have the app create another node at the midpoint of that segment.
I use didTapOverlay method to get the touch event, but unfortunately that just gives the poly line as a whole. How can I find out what line segment was tapped so I know where to insert the new coordinate in the GMSMutablePath array?
I've found a work around for this, but if anyone knows how to do this properly I'd love to hear it!!
Basically, instead of drawing a single polyline to represent the path, I drew a separate line between each coordinate in the path. I subclassed polyline and added a property "positionInPath", which I set when I created the line. In didTapOverlay, I used this property to determine where to insert the new coordinate in the GMSMutablePath.
Hope that helps someone!
Is there a way to change the default Google Maps direction line, the blue line that you are meant to follow, into a series of icons?
So instead of having a blue line showing the route on the map, I'd like to replace this with a series of small icons.
Or, if that isn't possible, can I place icons along the route in say 1km increments?
I see plenty of examples of replacing the start and end markers but not of the line.
Yes, it is possible. One option:
PolylineOptions to the DirectionsRenderer, you can also apply symbols to the Polyline
(example using a "dash" symbol)
or extract the route data and use it to put icons at all the vertices on the polyline (like the answer to this question, but with a transparent polyline)
example of a custom DirctionsRenderer
markers every 2km on a Polyline
markers at 2 arbitrary distances on a directions polyline
I know this will be a complex solution. I would appreciate it if you could push me in the right direction.
Please have a look at http://www.rightmove.co.uk/draw-a-search.html. I am interested in finding out how this is possible. what steps do I have to take to achieve this?
There's quite a few things going on here.
You need to have event listeners for when the user clicks on the map.
You need to place markers where they click.
You need to draw two types of polylines; the static type connecting two markers, and the dynamic dotted line as they move the cursor or drag a marker.
When you've closed up the polygon, you need to make your search only return properties inside that shape (although they're actually doing it within X miles radius from that shape).
They're also inserting markers half-way along the lines that you can drag - this will require the geographical library, using the interpolate function.
I am wondering how I can create two markers on a google map (upon click) and have a line drawn between them. Ideally both markers would be draggable after they are initially dropped and the line would readjust accordingly.
Maybe you can check this example, though is already deprecated it might help you to get an idea
http://maps.forum.nu/gm_flight_path.html