Ricky's profileRicky's Bing Maps BlogBlogSkyDrive Tools Help

Blog


    5/18/2009

    Dashed Polylines in Virtual Earth

    Virtual Earth has a lot of options for for working with shapes, unfortunately there are so many additional options that are not document (thus unsupported) that are available. However, just because it's not documented doesn't mean it can't be used, it just means that it may break at any time and if it does then it's no ones fault but your own. Now that the fair warning is out of the way here is how to draw dashed polylines.

    Before adding a polyline to the map set the VEShapeStyle.prototype.stroke_dashstyle  property to one of the following:

    • Solid
    • DashDot
    • ShortDash
    • ShortDot
    • ShortDashDot
    • ShortDashDotDot
    • Dot
    • Dash
    • LongDash
    • LongDashDot
    • LongDashDotDot

    For an added effect, resize the width of the polyline based on the zoom level.

    I've put together a nice little sample of how to do this which can be downloaded here:

    http://cid-e7dba9a4bfd458c5.skydrive.live.com/self.aspx/VE%20Sample%20code/dashedLines.zip

    Here is a screen shot of what the sample program looks like:

    image


    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.
    Ricky Brundritt has turned off comments on this page.

    Trackbacks

    The trackback URL for this entry is:
    http://rbrundritt.spaces.live.com/blog/cns!E7DBA9A4BFD458C5!871.trak
    Weblogs that reference this entry
    • None