This project is read-only.

Unfinished Marker crashes IE

Sep 8, 2008 at 3:30 AM
Hi Velio, the control works fine except one think. Look, i place a few markers on the GMap from DB. If address(es) resolved correct - i cand see all markers on map. If not,  unresolved addresses are NOT on the Gmap. THen i start next request, say, visitor changes region or number address to show on a map. Fun begins :)
FF ignored all throwen exception, but IE doesn't. My debuger shows:
Artem.Web.GoogleMarker.prototype =
{
    check: function()
    {
        if(!this.GMarker)
            throw "Cannot use it before marker been loaded!";

    },   
    initialize: function()     {        var eventName;  .............
As far as i understand the application can't ignore the unresilved marker and throws the exception above. FF ignore it, but IE doesn't/
Did i miss some settings for the control, say,
<artem:GoogleMap ID="GoogleMap1" runat="server" EnableIgnoreUnresolvedConflict="true" (or sort of like this)
Please, you suggestion :)

Voevoda
Sep 8, 2008 at 7:57 AM
I'll check out that.
However, I think I get the cause of the problem and have to change the code for adding unresolved markers - to simply not adding them :).

I have to find some time this week to work on all recent issues and publish new release.

Thanks for your feedback.

Regards
Sep 11, 2008 at 10:40 AM
Edited Sep 11, 2008 at 10:42 AM
Hi Velio.
Cool ! I hope U found out the time this week...

>> adding unresolved markers - to simply not adding them :).
Right, BUT: address is resolved on client, and added on Server :)
Did i miss some method that returns was address  resolved  correctly or not (on server/cs file), please?
Kinda:
    if(Resolved(theMarker)) Gmap.Markers.Add(theMarker);
      
if so - sure i should check address and if it's wrong just skip and do not add it to the Map,  take next one, so on ...
What do you think, please, Velio?

Voevoda
Oct 1, 2008 at 10:09 PM
Hello I fighting with the same issue. After loading map I add one marker on it. If address for the marker is resolved  - everything is working fine, but if not - I get strange errors like (this.Gf.width can not be null).
I would really apreciate for some idea how to check if address was resolved.

best regards
Gorgo
Oct 2, 2008 at 12:11 AM

It seems to me the resolved/valid addresses is  standalone  task, that means you need to check your address collection BEFORE to feed it to any DataSource J, i  guess

It should be kinda the following:

WebClient client = new WebClient();



String address=”Your address to validate goes here .....”;

address = HttpUtility.UrlEncode(address);

Uri uri  = new Uri(String.Format("{0}{1}&output={2}&key={3}", "http://maps.google.com/maps/geo?q=", address, "csv", "yourkey"));  // Available options: csv, xml, kml, json


/* The first number is the status code,
* the second is the accuracy,
* the third is the latitude,
* the fourth is the longitude.
*/


string[] geocodeInfo = client.DownloadString(uri).Split(',');
//geocodeInfo[0]; // Analize this one (sort of 200 means OK) if 200 -
à Add To your address list
//Convert.ToDecimal.ToDecimal(geocodeInfo[1]);

          //geocodeInfo[2] and geocodeInfo[3]

But it could be embedded in the class, i think

My best wishes ...

Voevoda

Oct 2, 2008 at 7:38 AM
Work item was created for this issue: http://www.codeplex.com/googlemap/WorkItem/View.aspx?WorkItemId=6336

Regards
Oct 4, 2008 at 7:43 PM
briliant ! Works perfectly !

thanks