Working with shapes in virtual earth
Displaying exact information on map is the main purpose when you will create your own virtual earth application. With virtual earth, three main shapes are given for providing information, polylines, polygons, and pushpins. All these three shapes are part of the same VEShape class. By making use of set and get methods, you will get the access for all the properties of shapes.
All these shapes are created by making use of VEShape constructor method. By accepting a parameter VEShape constructor method indicates collection of VELatlong and the shape type. You are thinking that only you have to perform the task of creating shape but along with this task you also have to set the shape properties and you have to insert the shape into the map.
Every shape object contains a collection of set and get methods, which permit you in communicating with these shapes. For instance, you are able to insert description and title for every pushpin. You are able to regulate the thickness and color for polylines and polygons.
Now we will see how to add a polygon. The process of adding a polygon is same as the process of adding a pushpin. However, to add polygon you must produce collection of points that represent the corners of a polygon. A polygon will get a transparent green fill, a pushpin is sitting somewhere in the middle of the area and a slim blue border by default. However, there is no need to worry about this because you are able to change this by making a small number of property settings. You have to note down one thing that each method to set color needs a VEColor object.
For each color object there is constructor which accepts a green, blue and red value. For each color object, there is constructor which accepts a green, blue and red value and it also accepts transparency value and an alpha. Now we will move on how to add a polyline. And adding polyline process is same as adding a polygon. Only the difference is in case of polygon you are able to turn off the icon and setting the thickness and color of the line. When you will get mastery over the basics for adding shapes, you are able to leverage various kinds of special properties for drastically changing the behavior and appearance of the project.
The first thing about which you have to be careful is to modify the default icon. When you will replace the custom icon property, you are able to replace the icon. This custom icon property refers to a raw string of HTML, a VECustomIconSpecification and URL of image. Every object contains various advantages and disadvantages. The easiest approach for changing the icon is just by creating your own icon and setting the custom icon property to point to the URL for that image.
And by making use of custom HTML you are able to do much more things. The point is that where you can change the icon to any kind of HTML string or to any kind of image that you want and you can also display the icon. Making use of VECustomIconSpecification object is the last option to change the icon.
Technorati Tags: Microsoft, virtual earth features of virtual earth,
Tags: Microsoft Virtual Earth
























