×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2014
    Posts
    6

    Question multiple marker-bubble problem

    Hi there,

    I am having an issue using many marker on the map according to my staff last location information that I am receiving from the system.
    Basically, I gather 5 or 10 staff location information from the mobile and want to see them on the map.

    I will post my code in here and will explain:

    I am initially loading the info of my staff such as the name, the lat, the long, the time and the last action. Then I start generating the javascript as below and send back to my page from this web service. As far as I am concerned that my array should be looping according to how I bind into it. However, it does not work the way I want to approach. The information comes up on the map randomly, for instance: the name and the time and the last action info can be on the first array item’s location on the map or can be the last array item on the map. It happens by a refresh on the page.
    Any idea ?
    Thank you very much

    foreach (var s in staffList)
    {
    staffLocation = new StaffLocationInformation();
    staffLocation = GetStaffLastLocation(s.StaffID);
    if (staffLocation.Lat != null && staffLocation.Long != null)
    {
    staffName += s.StaffFirstName + " " + s.StaffLastName + ",";
    latInfo += staffLocation.Lat + ",";
    lngInfo += staffLocation.Long + ",";
    timeInfo += staffLocation.Action + "-" + staffLocation.CreatedOn.ToString() + ",";
    }
    }

    if (latInfo.Length > 0 && lngInfo.Length > 0)
    {

    latInfo = latInfo.Substring(0, latInfo.Length - 1);
    lngInfo = lngInfo.Substring(0, lngInfo.Length - 1);
    staffName = staffName.Substring(0, staffName.Length - 1);
    timeInfo = timeInfo.Substring(0, timeInfo.Length - 1);
    string[] latArray = latInfo.Split(",".ToCharArray());
    string[] lngArray = lngInfo.Split(",".ToCharArray());
    string[] nameArray = staffName.Split(",".ToCharArray());
    string[] dateArray = timeInfo.Split(",".ToCharArray());

    StringBuilder cstext1 = new StringBuilder();
    //cstext1.Append("nokia.Settings.set(\"app_id\", \"" + NokiaMapAppID + "\"); nokia.Settings.set(\"app_code\", \"" + NokiaMapAppCode + "\");");
    //if (System.Configuration.ConfigurationManager.AppSettings["ProductionServer"] == "0")
    // cstext1.Append("nokia.Settings.set(\"serviceMode\", \"cit\");");
    //cstext1.Append("var mapContainer = document.getElementById(\"mapContainer\");");
    //cstext1.Append("var infoBubbles = new nokia.maps.map.component.InfoBubbles();");
    cstext1.Append(" var map = new nokia.maps.map.Display(mapContainer, { center: [" + latArray[0] + ", " + lngArray[0] + "], zoomLevel: 15, components: [ infoBubbles, new nokia.maps.map.component.ZoomBar(), new nokia.maps.map.component.Behavior(),new nokia.maps.map.component.TypeSelector(), new nokia.maps.map.component.Traffic(), new nokia.maps.map.component.PublicTransport(), new nokia.maps.map.component.DistanceMeasurement(), new nokia.maps.map.component.Overview(), new nokia.maps.map.component.ScaleBar(), new nokia.maps.positioning.component.Positioning(), new nokia.maps.map.component.ContextMenu(), new nokia.maps.map.component.ZoomRectangle() ] });");

    cstext1.Append("var dateTimeArray = [");
    for (int j = 0; j < nameArray.Length; j++)
    {
    cstext1.Append("\"" + dateArray[j] + "\",");
    }
    cstext1.Append("];");

    cstext1.Append(" var personNameArray = [");
    for (int j = 0; j < nameArray.Length; j++)
    {
    cstext1.Append("\"" + nameArray[j] + "\",");
    }
    cstext1.Append("],");
    cstext1.Append(" searchCenter = new nokia.maps.geo.Coordinate(" + latArray[0] + ", " + lngArray[0] + "),searchManager = nokia.places.search.manager,resultSet = new nokia.maps.map.Container(),marker, counter; counter = -1; map.objects.add(resultSet);");

    //map calling
    cstext1.Append(" var processResults = function (data, requestStatus, requestId) { var i, len, locations, marker; if (requestStatus == \"OK\") { locations = data.results ? data.results.items : [data.location]; if (locations.length > 0) { counter++; for (i = 0, len = locations.length; i < len; i++) { marker = new nokia.maps.map.StandardMarker(locations[i].position); resultSet.objects.add(marker); marker.$address = location.address; marker.$label = data.name; marker.$personName = personNameArray[counter]; marker.$dateText = dateTimeArray[counter]; } map.zoomTo(resultSet.getBoundingBox(), false); } else { } } else { } };");


    //event listener
    cstext1.Append(" var TOUCH = nokia.maps.dom.Page.browser.touch, CLICK = TOUCH ? \"tap\" : \"click\";");

    cstext1.Append("resultSet.addListener(CLICK, function (evt) { var marker = evt.target, address = marker.$address, label = marker.$label; personName = marker.$personName; dateText = marker.$dateText; if (marker instanceof nokia.maps.map.Marker) { infoBubbles.openBubble(\"<div ><h2 style='color:white;'>\" + personName + \"<br/>\" + dateText + \"<br/>\" + label + \"</h2></div>\", marker.coordinate); } });");


    //assing the address
    //cstext1.Append("var reverseGeoCodeTerm = new nokia.maps.geo.Coordinate(" + latArray[0] + ", " + lngArray[0] + ");");

    //initial load
    cstext1.Append("map.addListener(\"displayready\", function () { ");
    for (int k = 0; k < latArray.Length; k++)
    {
    cstext1.Append("searchManager.reverseGeoCode({ latitude: " + latArray[k] + ", longitude: " + lngArray[k] + ", onComplete: processResults }); ");
    }

    cstext1.Append(" });");
    string result = cstext1.ToString();
    string replaceThis = @"\";
    result = result.Replace(replaceThis, "");
    return result;
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,170

    Re: multiple marker-bubble problem

    And which API are you using ?, if it is HERE javascript API, then you should check where HERE is having their support implemented at

  3. #3
    Registered User
    Join Date
    Jul 2014
    Posts
    6

    Re: multiple marker-bubble problem

    Hi,

    I am using this version : http://developer.here.com/javascript-apis/api-explorer

    what do you mean by support implemented ? how can i access/contact them ?
    thank you

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,170

    Re: multiple marker-bubble problem

    check developer.here.com and see what they can offer.

  5. #5
    Registered User
    Join Date
    Jul 2014
    Posts
    6

    Re: multiple marker-bubble problem

    they refer me to ask the question in http://stackoverflow.com/ where I've already done, no reply so far

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,170

    Re: multiple marker-bubble problem

    Yep, then you just need to wait and see when there would be replies. HERE basically has their own service level and that's what they offer.

Similar Threads

  1. how to add a rich bubble to a Poi?
    By buptcoder in forum [Archived] MH5: Nokia Maps Framework for mobile HTML5
    Replies: 1
    Last Post: 2013-04-22, 17:34
  2. Replies: 31
    Last Post: 2011-01-24, 10:31
  3. Need a call bubble example...
    By enigma_007 in forum Symbian
    Replies: 5
    Last Post: 2009-09-15, 10:41
  4. Call Bubble like window.
    By valexey in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-01-13, 18:39
  5. Notification bubble
    By httpworks in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-11-14, 06:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×