ok I was a bit confused...but here's the deal, I've followed the thread, made changes and I still get this: Error Message The "ManageLocation" class referenced by "ManageLocation" does not appear to exist. Affected Elements ObjectFactory.NewObject();"
So for now, I'm leaving this alone till the next version or the download is fixed.
@houseinprogress:
This is fantastic, thank you! Any ETA on the graphical "choose location" interface? I'd be more than willing to help troubleshoot/beta the functionality if you're close to release.
We got the graphical interface working in Firefox but there's still a bug with IE that prevents the clickable map from loading. I forgot about it and stopped testing it...I'll see if we can figure it out.
I notice you've removed the Userpicture from the all-member map display. I was having a little difficulty accounting for different sized user pictures as well. If you're interested, I've changed the add-on slightly to display the user's Icon instead by editing lines 336+ with:
$result = mysql_query("SELECT A.latitude,A.longitude,A.Name,A.Icon,A.UserID FROM ".$this->Context->Configuration['DATABASE_TABLE_PREFIX']."User A WHERE A.latitude != 0 AND A.longitude != 0 $where",$this->Context->Database->Connection);
while ($row = mysql_fetch_row($result))
{
if ($row[0] <> 0 AND $row[1] <> 0)
{
$Image = '';
if ($row[3] != "") $Image = $row[3];
echo 'var point = new GPoint('.$row[1].','.$row[0].');
var marker = createMarker(point, \'<div style="width:200px; height:auto; text-align:left; color:#333;"><a style="font-weight:bold; color:#333" href="'.GetUrl($this->Context->Configuration, 'account.php','','u',$row[4]).'">'.addslashes($row[2]).'<\/a>';
if ($Image != "") echo '<br \/><img src="'.$Image.'" \/>';
echo '<\/div>\')
map.addOverlay(marker);';
}
One more quick thing! The current version of the add-on doesn't display the select location map in Safari on Windows. It's a quick fix, just edit the css for the GoogleMap class as follows:
i just downloaded this but when i go to Manage Map Location no map pops up; i must put in the longitude and latitude in order to set my location. i thought a map was supposed to load?
Hi, I didn't want to make my users figure out their lat/long so I added a quick hack for address lookup, maybe it'll be useful to someone else. Thanks for the nice add-on.
@line 202:
<script type="text/javascript">
//<![CDATA[
var geocoder = null;
geocoder = new GClientGeocoder();
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(address,
function(point) {
if (!point) {
alert("Sorry, " + address + " not found");
} else {
document.getElementById("txtlatitude").value = point.lat();
document.getElementById("txtlongitude").value = point.lng();
}
}
);
}
}
//]]>
</script>
and moved this form down from line 202 below the above form.
<form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'">
<input type="hidden" name="PostBackAction" value="ProcessManageLocation" />
<input type="hidden" name="u" value="'.$u.'" />
jpack, your little address lookup sounds perfect. Any chance you could post a link to your full code though? I haven't been able to implement your code changes successfully, the line numbers don't seem to be matching up for me. Thanks!
Hmm, it's possible other changes I've made shifted the line numbers around. Here's a diff against the clean downloaded of the MemberGoogleMap-2007-08-25 version. You should be able to just run patch with this. If that doesn't work whisper me your email and I'll just email you my live version of the file.
*** MemberGoogleMap/MemberGoogleMap/default.php Tue Sep 18 09:16:34 2007
--- default.php Fri Sep 7 14:50:55 2007
***************
*** 199,212 ****
echo '</div>';
}
echo '
! <form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'">
<legend>'.$this->Context->GetDefinition("ManageMapLocation").'</legend>
<fieldset>
- <input type="hidden" name="PostBackAction" value="ProcessManageLocation" />
- <input type="hidden" name="u" value="'.$u.'" />
<h2>'.$this->Context->GetDefinition("ManageMapTitle").'</h2>
<p class="Description">Please use the decimal format.</p>
<div id="GoogleMap"> </div>
<p>If you don\'t want to display your location insert a zero in both fields</p>
<ul>
<li>
--- 200,241 ----
echo '</div>';
}
echo '
! <script type="text/javascript">
! //<![CDATA[
!
! var geocoder = null;
! geocoder = new GClientGeocoder();
!
! function showAddress(address) {
! if (geocoder) {
! geocoder.getLatLng(address,
! function(point) {
! if (!point) {
! alert("Sorry, " + address + " not found");
! } else {
! document.getElementById("txtlatitude").value = point.lat();
! document.getElementById("txtlongitude").value = point.lng();
! }
! }
! );
! }
! }
! //]]>
! </script>
!
<legend>'.$this->Context->GetDefinition("ManageMapLocation").'</legend>
<fieldset>
<h2>'.$this->Context->GetDefinition("ManageMapTitle").'</h2>
<p class="Description">Please use the decimal format.</p>
<div id="GoogleMap"> </div>
+
+ <form action="#" onsubmit="showAddress(this.address.value); return false">
+ <ul><li>Lookup your Address <input type="text" name="address" maxlength="255" class="SmallInput" />
+ <input type="submit" value="Get Coordinates">
+ </form></ul>
+ <form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'">
+ <input type="hidden" name="PostBackAction" value="ProcessManageLocation" />
+ <input type="hidden" name="u" value="'.$u.'" />
<p>If you don\'t want to display your location insert a zero in both fields</p>
<ul>
<li>
Comments
thanks
Error Message
The "ManageLocation" class referenced by "ManageLocation" does not appear to exist.
Affected Elements
ObjectFactory.NewObject();"
So for now, I'm leaving this alone till the next version or the download is fixed.
Many thanks to Barbe for the suggestion and sample.
I notice you've removed the Userpicture from the all-member map display. I was having a little difficulty accounting for different sized user pictures as well. If you're interested, I've changed the add-on slightly to display the user's Icon instead by editing lines 336+ with:
$result = mysql_query("SELECT A.latitude,A.longitude,A.Name,A.Icon,A.UserID FROM ".$this->Context->Configuration['DATABASE_TABLE_PREFIX']."User A WHERE A.latitude != 0 AND A.longitude != 0 $where",$this->Context->Database->Connection); while ($row = mysql_fetch_row($result)) { if ($row[0] <> 0 AND $row[1] <> 0) { $Image = ''; if ($row[3] != "") $Image = $row[3]; echo 'var point = new GPoint('.$row[1].','.$row[0].'); var marker = createMarker(point, \'<div style="width:200px; height:auto; text-align:left; color:#333;"><a style="font-weight:bold; color:#333" href="'.GetUrl($this->Context->Configuration, 'account.php','','u',$row[4]).'">'.addslashes($row[2]).'<\/a>'; if ($Image != "") echo '<br \/><img src="'.$Image.'" \/>'; echo '<\/div>\') map.addOverlay(marker);'; }
Again, thank you!
#GoogleMap { margin-top:4px; margin-bottom:4px; text-align:center; border:1px solid #666; padding-top:5px; padding-bottom:5px; width:400px; height:300px; }
@line 202:
<script type="text/javascript"> //<![CDATA[ var geocoder = null; geocoder = new GClientGeocoder(); function showAddress(address) { if (geocoder) { geocoder.getLatLng(address, function(point) { if (!point) { alert("Sorry, " + address + " not found"); } else { document.getElementById("txtlatitude").value = point.lat(); document.getElementById("txtlongitude").value = point.lng(); } } ); } } //]]> </script>
@line 210
<form action="#" onsubmit="showAddress(this.address.value); return false"> <ul><li>Lookup your Address <input type="text" name="address" maxlength="255" class="SmallInput" /> <input type="submit" value="Get Coordinates"> </form></ul>
and moved this form down from line 202 below the above form.
<form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'"> <input type="hidden" name="PostBackAction" value="ProcessManageLocation" /> <input type="hidden" name="u" value="'.$u.'" />
If that doesn't work whisper me your email and I'll just email you my live version of the file.
*** MemberGoogleMap/MemberGoogleMap/default.php Tue Sep 18 09:16:34 2007 --- default.php Fri Sep 7 14:50:55 2007 *************** *** 199,212 **** echo '</div>'; } echo ' ! <form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'"> <legend>'.$this->Context->GetDefinition("ManageMapLocation").'</legend> <fieldset> - <input type="hidden" name="PostBackAction" value="ProcessManageLocation" /> - <input type="hidden" name="u" value="'.$u.'" /> <h2>'.$this->Context->GetDefinition("ManageMapTitle").'</h2> <p class="Description">Please use the decimal format.</p> <div id="GoogleMap"> </div> <p>If you don\'t want to display your location insert a zero in both fields</p> <ul> <li> --- 200,241 ---- echo '</div>'; } echo ' ! <script type="text/javascript"> ! //<![CDATA[ ! ! var geocoder = null; ! geocoder = new GClientGeocoder(); ! ! function showAddress(address) { ! if (geocoder) { ! geocoder.getLatLng(address, ! function(point) { ! if (!point) { ! alert("Sorry, " + address + " not found"); ! } else { ! document.getElementById("txtlatitude").value = point.lat(); ! document.getElementById("txtlongitude").value = point.lng(); ! } ! } ! ); ! } ! } ! //]]> ! </script> ! <legend>'.$this->Context->GetDefinition("ManageMapLocation").'</legend> <fieldset> <h2>'.$this->Context->GetDefinition("ManageMapTitle").'</h2> <p class="Description">Please use the decimal format.</p> <div id="GoogleMap"> </div> + + <form action="#" onsubmit="showAddress(this.address.value); return false"> + <ul><li>Lookup your Address <input type="text" name="address" maxlength="255" class="SmallInput" /> + <input type="submit" value="Get Coordinates"> + </form></ul> + <form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'"> + <input type="hidden" name="PostBackAction" value="ProcessManageLocation" /> + <input type="hidden" name="u" value="'.$u.'" /> <p>If you don\'t want to display your location insert a zero in both fields</p> <ul> <li>