thebottgroup
 XMod Rookie Posts: 9

 |
| 12/20/2007 4:29 PM |
|
| Thank you Scott - I truly appreciate your patience - I was just going to fast - have a geat holiday |
|
|
|
|
mitmit
 XMod Jr. Varsity Posts: 18

 |
| 12/29/2007 6:17 AM |
|
Im using this wounderful solution, thank you for this. I have made a listpage with a TEXT/HTML module to display the list, it works fine. When you click a "ballon" and the information on the map show i have made a link to the detailpage. This works fine. On the detailpage i want to display the map but only on the detailedshown ballon. I have included the code that i normaly use in a TEXT/HTML module but this time at the bottom of the detailedtemplate. This works fine if im logged in as host, but when i logout and are a visitor i cant see the ballon, only the map. But as i say, the ballon is shown on the map togheter with all the information i want in the detailedtemplate. Anyone knowing why? Greatful for help |
|
|
|
|
chaloum
 XMod All-Star Posts: 169
 www.edmedia.com.au
 |
| 1/03/2008 5:19 AM |
|
My interest was sparked by another users fourms comment regarding clickable side bar and sidebar highlighting as shown in this link http://econym.googlepages.com/example_map2c.htm I've been trying to sort it out but the events handler and identifying the marker id that needs to be associated with the anchors href is causing me some grief any this is the code from the example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Google Maps</title> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAPDUET0Qt7p2VcSk6JNU1sBRRwPhutbWBmyj82Go_H6JlE7EvFBSKFFFHFePAwvib9UM0geoA3Pgafw" type="text/javascript"></script> </head> <body onunload="GUnload()"> <!-- you can use tables or divs for the overall layout --> <table border=1> <tr> <td> <div id="map" style="width: 550px; height: 450px"></div> </td> <td width = 150 valign="top" style="text-decoration: underline; color: #4444ff;"> <div id="side_bar"></div> </td> </tr> </table> <a href="basic2.htm">Back to the tutorial page</a> <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b> However, it seems JavaScript is either disabled or not supported by your browser. To view Google Maps, enable JavaScript by changing your browser options, and then try again. </noscript> <script type="text/javascript"> //<![CDATA[ if (GBrowserIsCompatible()) { // this variable will collect the html which will eventually be placed in the side_bar var side_bar_html = ""; // arrays to hold copies of the markers and html used by the side_bar // because the function closure trick doesnt work there var gmarkers = [] var i = 0; var lastlinkid; // A function to create the marker and set up the event window function createMarker(point,name,html) { var marker = new GMarker(point); var linkid = "link"+i; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); document.getElementById(linkid).style.background="#ffff00"; lastlinkid=linkid; }); // save the info we need to use later for the side_bar gmarkers[i] = marker; // add a line to the side_bar html side_bar_html += '<div id="'+linkid+'"><a href="javascript:myclick(' + i + ')">' + name + '</a><br></div>'; i++; return marker; } // This function picks up the click and opens the corresponding info window function myclick(i) { GEvent.trigger(gmarkers[i], "click"); } // create the map var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng( 43.907787,-79.359741), 8); // add the points var point = new GLatLng(43.65654,-79.90138); var marker = createMarker(point,"This place","Some stuff to display in the<br>First Info Window") map.addOverlay(marker); var point = new GLatLng(43.91892,-78.89231); var marker = createMarker(point,"That place","Some stuff to display in the<br>Second Info Window") map.addOverlay(marker); var point = new GLatLng(43.82589,-78.89231); var marker = createMarker(point,"The other place","Some stuff to display in the<br>Third Info Window") map.addOverlay(marker); GEvent.addListener(map,"infowindowclose", function() { document.getElementById(lastlinkid).style.background="#ffffff"; }); // put the assembled side_bar_html contents into the side_bar div document.getElementById("side_bar").innerHTML = side_bar_html; } else { alert("Sorry, the Google Maps API is not compatible with this browser"); } // This Javascript is based on code provided by the // Blackpool Community Church Javascript Team // http://www.commchurch.freeserve.co.uk/ // http://econym.googlepages.com/index.htm //]]> </script> </body> </html> it is using the following js function function myclick(i) { GEvent.trigger(gmarkers[i], "click"); } which I gather is triggered by the code where i is the marker id... <div id="'+linkid+'"><a href="javascript:myclick(' + i + ')">' + name + '</a><br></div> the issue is in the xmap version the sidebar is rendered directly from the Xmod field and the markers are displayed using arrays in js where the example is rendering the sidebar as part of the js execution which associates the marker Id with the clickable link and vice versa... anyhow How can the above example be done using the xmap method |
|
EDMEDiA Australia - - www.edmedia.com.au eLearning and Organisational Development |
|
|
chaloum
 XMod All-Star Posts: 169
 www.edmedia.com.au
 |
| 1/04/2008 8:09 AM |
|
I think Ive got it almost sorted out http://www.dnndev.com/Forums/tabid/215/forumid/1/postid/18076/view/topic/Default.aspx just an issue with syncronising the side bar div tag ids with the maker id. I anyone know how to refine it would be appreciated |
|
EDMEDiA Australia - - www.edmedia.com.au eLearning and Organisational Development |
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 1/04/2008 3:25 PM |
|
I've thrown together a solution. You can see it here... http://www.marinapal.com/Dev/geocoder/GeocoderListview/tabid/376/Default.aspx and get the code here... http://www.marinapal.com/Dev/geocoder/GeocoderCode/tabid/380/Default.aspx I moved the repeating javascript to the top and used document.write to create the opening div tag so it could have a unique onclick event. |
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|
chaloum
 XMod All-Star Posts: 169
 www.edmedia.com.au
 |
| 1/04/2008 4:13 PM |
|
hey Scott great I'll combine your method with the one i've done that way it will have the div highlighting in both directions and the wheel zoom. you can see it on www.roadsidestalls.com |
|
EDMEDiA Australia - - www.edmedia.com.au eLearning and Organisational Development |
|
|
chaloum
 XMod All-Star Posts: 169
 www.edmedia.com.au
 |
| 1/04/2008 4:17 PM |
|
Scott I cant access the page with the new code it gives an error "object required at line 38" |
|
EDMEDiA Australia - - www.edmedia.com.au eLearning and Organisational Development |
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 1/04/2008 4:44 PM |
|
| It appears my Donation button is messed up in IE and is throwing the errors for the page. But I have no clue why IE won't display the text file in the browser. I've attached the code to this post. |
Attachment: 11444973571.txt
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 1/04/2008 4:46 PM |
|
| It looks like IE is trying to open it as a web page. You can right click the link and "Save As". |
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|
StevenMagaric417
 XMod Jr. Varsity Posts: 15

 |
| 5/11/2008 12:11 PM |
|
It seems that I am the only only person who can't Xmap to run right. The formview works fine and I can add a marker and get redirected back to the listview page and this is where my problem is. The list draws fine with the list of markers and the text/html map draws the google map but doesn't render the markers. Also when I click the list items, nothing happens. I have checked the code over and over again and just can't find anything wrog in the listview code. Can anyone give me some pointers to troubleshoot? My site is here http://www.panama-zone.com/Misc/Xmod/tabid/758/Default.aspx Steve |
|
|
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 5/11/2008 2:42 PM |
|
Hi Steve, It seems your DNN_Menu skin object found a weak spot in my code. I use the javascript variable i as a counter, as do most coders. I didn't however clear the value before adding the points using the listview. i was left with a value of 1 instead of 0 which is what messed things up. Add the following to the listview header of the listview module header. <script type="text/javascript"> var i = 0 </script> That should fix it. |
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|
StevenMagaric417
 XMod Jr. Varsity Posts: 15

 |
| 5/11/2008 2:57 PM |
|
Thanks for taking the time to look at the problem. I added the script at the very top of the listview code as suggested but it still doesn't work. Maybe I need to change the variable name to something else so there is no conflict. What do you think? Steve |
|
|
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 5/11/2008 3:30 PM |
|
| You need to move it to the "header" . Go into the module settings and under "advanced settings" you'll see a textbox for the header. By putting it in the listview code, it gets repeated for ever record, in other words, it resets the value to zero for each record. |
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|
StevenMagaric417
 XMod Jr. Varsity Posts: 15

 |
| 5/11/2008 3:52 PM |
|
Putting it in the header did not work either but it is definetly the menu skin object that was causing the problem. I switched to another skin and it works great. I would like to be able to figure out a way to fix it so I can use my menu skin object though. What if I change the var i to something else like j, will that help? Steve |
|
|
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 5/11/2008 4:20 PM |
|
| I can't be sure that would fix it. If you could put the old skin back up, I'd like to take another look and see what else the problem may be. |
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|
StevenMagaric417
 XMod Jr. Varsity Posts: 15

 |
| 5/11/2008 4:38 PM |
|
The old skin is back up now. Steve |
|
|
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 5/11/2008 5:15 PM |
|
Did you take the code out of the header? I don't see it. I also realized I forgot a semicolon in the code I gave you. Try this in the header. <script type="text/javascript"> var i = 0; </script> Make sure you do a Ctrl-F5 to refresh the page. |
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|
StevenMagaric417
 XMod Jr. Varsity Posts: 15

 |
| 5/11/2008 5:21 PM |
|
I put the code back in the header with the smi colon but it still isn't working yet. Steve |
|
|
|
|
chaloum
 XMod All-Star Posts: 169
 www.edmedia.com.au
 |
| 5/11/2008 5:58 PM |
|
try this http://www.roadsidestalls.com/SystemAdmin/MapDev/tabid/210/Default.aspx the view list code is there and the other views a forms are the same as the other examples. have a go |
|
EDMEDiA Australia - - www.edmedia.com.au eLearning and Organisational Development |
|
|
captscott019
 XMod All-Star Posts: 902
 www.marinapal.com Jersey City, NJ (for the summer)
 |
| 5/11/2008 6:00 PM |
|
Well, I don't know why that didn't fix it, so I guess I'll go with renaming the variable. In the listview, replace this chunk of code... <script type="text/javascript"> var iCt = iCt + 1; x[iCt] = <xmod:field name="Latitude" />; y[iCt] = <xmod:field name="Longitude" />; d[iCt] = '<xmod:field name="Name" class="NormalBold" /><br /><br /><xmod:field name="Street" class="Normal"/><br /><xmod:field name="City" class="Normal"/> <xmod:field name="State" class="Normal"/> <xmod:field name="Zip" class="Normal"/>'; document.write('<div width="150px" onclick="myGclick(' + iCt + ');">') </script> I just renamed i to iCt. There is still the possibility of conflict, but it is much less now. Thank you for bringing this to my attention and working with me to resolve it. Cheers |
|
Scott Jennings - www.marinapal.com
"Personally I'm always ready to learn, although I do not always like being taught." - Sir Winston Churchill |
|
|