Niseeth


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 ..





Re: virtual earth and xaml pushpin

Mo Majad


Please post code





Re: virtual earth and xaml pushpin

Niseeth

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: {}
});

}





Re: virtual earth and xaml pushpin

Mo Majad

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




Re: virtual earth and xaml pushpin

Niseeth

its not helpful to me..

I want to add a xaml pushpin not image type ..

Do u have any idea

NIsheeth






Re: virtual earth and xaml pushpin

Mo Majad

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





Re: virtual earth and xaml pushpin

Niseeth

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






Re: virtual earth and xaml pushpin

Mo Majad

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





Re: virtual earth and xaml pushpin

Niseeth

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);






Re: virtual earth and xaml pushpin

Mo Majad

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