virtual earth and xaml pushpin
I am using silver light alpha 1.1 sep version with virtual earth in this i add all shapes(eprox 140)which in xaml shape. But the map can't be load on map.
The browser hanged..
What is the solution please replay me ..?
I am using silver light alpha 1.1 sep version with virtual earth in this i add all shapes(eprox 140)which in xaml shape. But the map can't be load on map.
The browser hanged..
What is the solution please replay me ..?
Here is the code to create XMAL pushpin.
for(i=0;i<200;i++)
{
var myPushpin = new VEShape(VEShapeType.Pushpin,new VELatLong(lat,long));
var XAMLCntnr=null;
XAMLCntnr = document.createElement('div');
XAMLCntnr.id="myXAMLCntnr";
document.body.appendChild(XAMLCntnr);
Silverlight.createObjectEx({
source: "Page4.xaml",
parentElement: document.getElementById("myXAMLCntnr"),
id: "",
properties: {
width: "22px",
height: "23px",
version: "1.0",
isWindowless:'true',
background:'#00000000',
enableHtmlAccess: true
},
events: {}
});
There is an interesting article to0 do with silverlight and virtual earth which may help you:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2173767&SiteID=1
hope it helps
its not helpful to me..
I want to add a xaml pushpin not image type ..
Do u have any idea ?
NIsheeth
for starters your id value should be unique
XAMLCntnr.id="myXAMLCntnr";
and
parentElement: document.getElementById("myXAMLCntnr")
should be something like:
XAMLCntnr.id="myXAMLCntnr"+i;
and
parentElement: document.getElementById("myXAMLCntnr"+i)
hope this helps
regards
Mo
Thanks Mo Majad
But its create too many objects thats i dont wnat to do that and its also not seen on map.
thats why i cant use that.
any othere idea...
Thanks in advance.
Nisheeth
But Niseeth, that is exactly what your code is asking it to do, create 200 objects in the for loop?
if you dont want that many objects why place in a for loop? why not just create the one.
regards
Mo
hi Mo Majad,
In SilverLight when we create a object to display xaml control on map we have to give the position or the div id where we want to display the xaml control.
So i have to create a div every time to when pushpin is add and by default the div is created where the pushpin is just added. so i have to create a div every time and after that i remove that div after the map.AddShape(). and recreate that div.
if i give the id for the xaml thats not need.
or i give the id its not affact the application.
I think there is a bug in silverlight that we can't add more than 50-100 xaml control.
Now if you have more idea.
please post me.
for(i=0;i<200;i++)
{
var myPushpin = new VEShape(VEShapeType.Pushpin,new VELatLong(lat,long));
var XAMLCntnr=null;
XAMLCntnr = document.createElement('div');
XAMLCntnr.id="myXAMLCntnr";
document.body.appendChild(XAMLCntnr);
Silverlight.createObjectEx({
source: "Page4.xaml",
parentElement: document.getElementById("myXAMLCntnr"),
id: "",
properties: {
width: "22px",
height: "23px",
version: "1.0",
isWindowless:'true',
background:'#00000000',
enableHtmlAccess: true
},
events: {}
});
}
document.removeChild(XAMLCntnr);
sorry Niseeth, no idea as to what you are trying to do here, but you may want to look up ASP.Net Futures xaml control and see if that helps you in this situation
regards
Mo