Showing posts with label earth. Show all posts
Showing posts with label earth. Show all posts

Wednesday, March 28, 2012

Very rich data to be presented in pushpin popup - how to?

Hello,

suppose we have a list of objects retrieved from a webservice which we want to present in Virtual Earth Map as a set of pushpins. And one of fields of the object (presented in one pushpin) is another list. For example consider object of the following class:

1public class Point2{3string city;4string lat;5string lon;6 List<Person> list;7}
 wherePerson is another class like:
 1public class Person2{3string firstname;4string lastname;5string about;6}  

Now, I need to make a pushpin from every Point object of the list retrieved from the webservice. That's the easy part. :)

My problem is how to present the list of - let say - lastnames from List<Person> list in pushpin popup. Any ideas how to do it in a declarative way?

I'm still using the Atlas, not ASP.NET AJAX.

Please! Any help! I'm so confused :)

Hi,

check the mashup in my signature, it performs something similar, but with a list of images. You can download the source code.


Wow. This is a very nice application. :)I'm studying it hard.

Maybe you know some good sources of information about xml-script?


Just wondering, is your demo updated for the Beta release?

Hi,

no, at the moment it works only with the July CTP.


So, any clues where to find information about programming Atlas in a declarative way (by XML-script)?

Your demo is excellent example, but still example and I would love to learn all of it :) The old Atlas documentation is not available. Maybe someone has it?

Virtual Earth - Pushpin Layer not Updated

i'm trying to implement geotagging on my website that allow my blog reader to add themselves to the map using pushpin.under my map i've several field for the users to key in their details then upon clicking the "add" button... their details will be appended to a georss xml file... and this step works fine as the details can be appended without problem... but when the page refreshes after my user hav clicked the "add" button... the details added are not shown... and even click "refresh" on IE wont help... all i got to do to get the newly added details shown is to close the current IE and re-request the page in a new IE... then all the pushpins(including the last pushpin added) can be shown... y is this problem occuring? am i doing anything wrong??Thanks,Any chance you can post the code so I can see if you are doing anything wrong?

Thanks for your fast reply...well... here's my code:

to load the map:

1 var map = null;2 var layerid = 1;34 function AddMyLayer()5 {6 var veLayerSpec = new VELayerSpecification();7 veLayerSpec.Type = VELayerType.GeoRSS;8 veLayerSpec.ID = layerid;9 veLayerSpec.LayerSource = 'Location.xml';10 veLayerSpec.Method = 'get';11 map.AddLayer(veLayerSpec);12 }
to add pushpin and get the position:
1 function AddPin()2 {3 var pin = new VEPushpin(4 pinID,5 map.GetCenter(),6 null,7 null,8 null9 );10 map.AddPushpin(pin);1112 if (pinID != 1)13 {14 var intpin = pinID - 1;15 map.DeletePushpin(intpin);16 }1718 document.getElementById('<%=lblPosition.ClientID%>').innerText = map.GetCenter();19 pinID++;20 }
asp.net code to store position and details to XML
1Protected Sub btnAdd_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)2Dim xmldocAs New XmlDocument3 xmldoc.Load(Server.MapPath("Location.xml"))4Dim eleItemAs XmlElement = xmldoc.CreateElement("item")5Dim eleTitleAs XmlElement = xmldoc.CreateElement("title")6Dim textTitleAs XmlText = xmldoc.CreateTextNode(txtName.Text)7Dim eleBlogAs XmlElement = xmldoc.CreateElement("link")8Dim textBlogAs XmlText = xmldoc.CreateTextNode(txtBlog.Text)9Dim elePositionAs XmlElement = xmldoc.CreateNode(XmlNodeType.Element,"georss","point","http://www.georss.org/georss")10Dim strPositionAs String = Request.Form("lblPosition") // to get position11Dim textPositionAs XmlText = xmldoc.CreateTextNode(strPosition)12Dim eleDescAs XmlElement = xmldoc.CreateElement("description")13Dim textDescAs XmlText = xmldoc.CreateTextNode(txtDesc.Text)1415 eleItem.AppendChild(eleTitle)16 eleTitle.AppendChild(textTitle)17 eleItem.AppendChild(eleBlog)18 eleBlog.AppendChild(textBlog)19 eleItem.AppendChild(elePosition)20 elePosition.AppendChild(textPosition)21 eleItem.AppendChild(eleDesc)22 eleDesc.AppendChild(textDesc)2324Dim rootAs XmlElement = xmldoc.Item("feed")25 root.AppendChild(eleItem)2627 xmldoc.Save(Server.MapPath("Location.xml"))2829 Response.Redirect("Map.aspx?Session=" + DateTime.Now.Millisecond.ToString + DateTime.Now.Second.ToString + DateTime.Now.Minute.ToString)3031End Sub
so what do you think? is that the XML is being cache by Virtual Earth? so even the XML is updated... but VE is still refering to the cache data?
thanks... 

Actually I do not see anything wrong as far as I can tell. What do you get on this line?:
document.getElementById('').innerText = map.GetCenter();My only guess is you don't get the right Client ID? Otherwise I'm lost sorry

document.getElementById('').innerText = map.GetCenter();
this line is to get the position of the pushpin to be stored in the XML file...

actually as you said... the code has no problem and is working fine... it can add pushpin on the map... and after clicking "Add" button... all the information such as Name, position etc. can be appended to the XML file...

but now the problem is... even all the information are appended correctly... but the appended information cannot be shown...

let say i've one set of information in my XML file... then when the first time i start my page... the pushpin can be shown on the map... then i add another pushpin... and click "Add"... the page refreshes... appending the XML file... but the map(or the pushpin layer) is not updated...

i have to close my IE and restart it to get my second pushpin to be shown... refreshing wont help... neither does CTRL + F5... that is the only problem which i think is VE's problem... haha...

any clue? haha...

Virtual Earth Control

How would I set the initial properties of the virtuaEarthMap control?

<virtualEarthMap targetElement="map" Latitude="22" Longitude="-100"MapStyle="Hybrid" ZoomLevel="9" CssClass="map" DataValueField="ID"DataTextField="Name" PushpinCssClass="pushpin"PushpinActivation="Hover">
</virtualEarthMap
Doesnt seemt to work :(
The map "base" shows up, but none of the actual map tiles are showing.

Any help would be awesome :)I have worked with the Virtual Earth before using just the javascriptand found we could display the dashboard but I looked in theAtlasUIMap.js and can't reference any mention of the dashboard ?

Virtual Earth support has since been pulled out of the ASP.NET AJAX "Atlas" Extensions. Because of this, I created a ASP.NET AJAX Virtual Earth Mapping Server Control located here:http://simplovation.com/Page/WebMapsVE.aspx

Virtual Earth Connection/Event Problem When Nested In AJAX Control

Well, I was told today that I needed to make a web portal by the end of the month using .net technologies (my handle says it all) and I just hit my first roadblock.

In a condensed nutshell, I am trying to implement theVirtual Earth tool in an asp.net ajax tab control. When the VE <div> is located outside of the tab control then it works, but when I try to load it inside of the TabPanel it doesn't scroll properly and doesn't refresh.

I clipped out everything from my default.aspx except for the problem (below). Help is very much appreciated.

===================== SOURCE =================

<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"%> <!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <scriptsrc="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=4"></script> <scripttype="text/javascript">var map =null; function GetMap() { map =new VEMap('myMap'); map.LoadMap(); }</script> <htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"> <title>Map</title> <metahttp-equiv="Content-Type"content="text/html; charset=utf-8"></head><bodyonload="GetMap();"> <formid="form1"runat="server"> <ajaxToolkit:ToolkitScriptManagerID="ScriptManager1"runat="server"> <Scripts> <asp:ScriptReferencePath="Map.js"> </asp:ScriptReference> </Scripts> </ajaxToolkit:ToolkitScriptManager> <ajaxToolkit:TabContainerID="TabContainer1"runat="server"ActiveTabIndex="0"ScrollBars="Auto"> <ajaxToolkit:TabPanelID="TabPanel1"runat="server"HeaderText="Map Tab"> <ContentTemplate> <divid='myMap'style="position: relative; width: 400px; height: 400px;"/> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> </form></body>

</html>

===================== END SOURCE =================

I had the same problems working with TabContainer Control and Virtual Earth Control .

A workournd I have found that partially solves this issue is to remove the code

ActiveTabIndex="0"

from the definition of the TabContainer control.

You may find more info on this on this URL :

http://www.dotnetside.org/blogs/lucab/archive/2007/10/05/Mappe-di-Virtual-Earth-e-controllo-Tabs-di-AJAX-Control-Toolkit.aspx

George

Virtual Earth and firefox

Hello.
I have some fun with VirtualEarthMap control last night :) I was tryingto make it work in Firefox. The problem occured to be in DOCTYPEdeclaration,
after removing it maps displays well but we can't still change its sizein associated cssClass. After a moment of investigation I used#id_of_map_control instead of cssClass in css stylesheet - works well!
What I ve done is working but isn't elegant :) Maybe I am missing something?
Best regards,
Marcin Daczkowski
That's a bug in the map control. When you apply the class, you apply itto a container div. That container contains a div, in which the actualmap is placed. When the map is initialized, the control uses thewidth/height of this div as the width/height of the map. Your classobviously does not apply to this inner div, which means it will have adefault height/width.

Hello
Thanks for explaination. I was investigating source code and found thatdiv in div, too. But my knowledge of css implementations is not deep -I've found "hack" but was not sure if there is no better (proper)solution (after I have found nothing on google about this i was surethat I am doing sth wrong). Now everything is clear. Thanks!

Best wishes,
Marcin Daczkowski

Virtual Earth: Mapstyle - oblique Question

It seems like March CTP doesn't includue Mapstyle - Oblique. Is that ture?

Correct, the Atlas March CTP does not support the Oblique feature of Virtual Earth.

Virtual Earth v4/ASP.NET AJAX v1.0 Beta 2 Bug

Hi All,

I ran into a bug with the Virtual Earth v4/ASP.NET AJAX v1.0 Beta 2 combination in which I receive the following error:

Sys.InvalidOperationException: Object Microsoft already exists and is not a namespace.

The following is a simple reproducible case. I would really appreciate it if someone from Microsoft could confirm that they are aware of this bug and provide status.

I have also posted this message in the Virtual Earth forum in reply to SpeedOfSPin's post(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=897625&SiteID=1) regarding this bug as I am not sure in which team's product the issue resides.

This is not an issue if I revert back to using Virtual Earth v3 but obviously I would prefer to be able to make use of v4.

1<%@dotnet.itags.org. Page Language="C#" %>23<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
45<script runat="server">
67</script>
89<html xmlns="http://www.w3.org/1999/xhtml">
10<head id="Head1" runat="server">
11 <title>Virtual Earth v4/ASP.NET AJAX v1.0 Beta 2 Bug</title>
12 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1314 <script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
1516 <script type="text/javascript">
17 function pageLoad()
18 {
19 var map = new VEMap('map');
20 map.LoadMap();
21 }
22 </script>
2324</head>
25<body>
26 <form id="form1" runat="server">
27 <asp:ScriptManager ID="ScriptManager1" runat="server">
28 </asp:ScriptManager>
29 <div id="map" style="position: relative">
30 </div>
31 </form>
32</body>
33</html>
34
Thanks a lot,I'm also having this issue. Has anyone found a work around?
Anyone? MSFT?

I'm struggling with this as well. Here's another thread regarding the issue:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=897625&SiteID=1

I hope this gets resolved soon.


Virtual Earth Question

Has anyone used the new build of Atlas to display the Virtual Earth control? I am unable to make it work. All I get is the copyright message from microsoft and the background image but not the maps

Any help would be great!!

<components>
<virtualEarthMap id="map" latitude="43.644755000"longitude="-79.392211000" zoomLevel="10" />
</components
that works :)

but looking to see if the Dashboard can be displayed:

params.showDashboard = false;
_map = new Msn.VE.MapControl(this.element, params);

Why is the Dashboard default to not show and theres no way of passingin the parameter or changing the JS ourselves since it is packaged intothe DLL now...

What alternatives can we do in using VE Control in Atlas and customizing the properties?

virtual earth makes autocomplete half transparent in firefox

hi, i just spent almost a day on this. any help/advices would really be appreciated.

i attempted to put 2 of the coolest asp.net tools to work together on the same page, but found that it doesn't work for firefox.

i have the autocomplete in "SampleWebSite" working, but as soon as i added the below VE js reference, the auto-complete list went half-transparent and went behind the map area.

<script language="javascript" src="http://pics.10026.com/?src=http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>

so, i provided my own div element with a very high z-index, but it's still half transparent. it only happens in firefox.

<div id="completingName" style="z-index:999999;"></div>

see this, http://208.75.249.11/map.jpg

thank you very much.

Are you using the latest version of the Toolkit? What is the behavior in other browsers? What is the z-index of the flyout and the ve control?


i believe i am using the latest version of asp.net ajax toolkit because i just downloaded it this morning. virtual earth is 5.0.

other IE is fine, no problem. i just have problem with firefox (http://208.75.249.11/map.jpg), don't know about others.

thank you very much.


Could you please provide the repro? Thanks.


Not sure if this helps, but I had a transparency problem with firefox too. I used the exact styles from the AutoComplete sample and got the following problems in Firefox:

1) the items in the list were all indented by about 20 pixels (whereas in IE all the items in the list were left-aligned with the start of the text box.)

2) Textboxes underneath the autocomplete list were showing through the list, they weren't being covered when the autocomplete list appeared.

I'm not great with CSS, but a colleague was able to fix the issue by making the following CSS changes (the original styles were copied from the Autocomplete sample on this site):

in class ".autocomplete_completionListElement"

change "background-color:inherit;" to "background-color : #fff;"

and add a new style to the class:

"padding:0;"

So you end up with:

.autocomplete_completionListElement
{
visibility : hidden;
margin : 0px!important;
background-color : #fff;
color : windowtext;
border : buttonshadow;
border-width : 1px;
border-style : solid;
cursor : 'default';
overflow : auto;
height : 200px;
text-align : left;
list-style-type : none;
padding:0;
}

Hope this helps,

Ollie

Virtual Earth kills Accordion

Adding a reference to the VE script makes the content area of the Accordion Control invisible in Firefox. In IE it works fine.

Anybody experienced the same problem and/or found a solution/hack?
I guess you can't use the Accordion control in a VE application and we will have to redesign the user interface...

Ueli
5:PM serious Technology, Brazil

1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">2<html xmlns="http://www.w3.org/1999/xhtml" >3<head>4 <title>Test Page</title>5 <script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>6</head>7<body>8 <form id="form" runat="server">9 <asp:ScriptManager ID="ScriptManager" runat="server" />10 <ajaxToolkit:Accordion ID="Accordion" runat="server" AutoSize="Fill" >11 <Panes>12 <ajaxToolkit:AccordionPane runat="server">13 <Header>Header A</Header>14 <Content>Content A</Content>15 </ajaxToolkit:AccordionPane>16 <ajaxToolkit:AccordionPane runat="server">17 <Header>Header B</Header>18 <Content>Content B</Content>19 </ajaxToolkit:AccordionPane>20 </Panes>21 </ajaxToolkit:Accordion>22 </form>23</body>24</html>

phew found a solution, was worried there for a second

Basically for some reason or other VE is applying a opacity:0.1 (inline styling) to all the accordian divs in firefox which makes them not display.

To override this you have to do the following

#youraccordianid div
{
opacity:1 !important;
}

This makes all divs of your accordian have an opacity = 1 the !important tells FF & IE7 that this should override all other style

Hope this helps others

Brian Norman
www.earthware.co.uk