Important! A new Community experience launched on September 26, 2017. Read more about it here or continue to Base Camp.
Voting: 
Vote up!
0 Votes
5 Replies
Answered

How to set Map widget's location data

Question asked by paramatma on Oct 25, 2010 06:55 EDT

We can set map widget location data as below: [color=green]formID.mapwidgetID.locationdata[/color] = { {"43.47591","-80.53964", "Citibank", "My College Campus", "marker.png", {color="green", label="C"}}, {"43.47621","-80.54034", "Citibank", "My School Campus", "ymarker.png", {color="red", label="A"}} }; [color=red]Note:[/color] In the Above location data-table, each row elements are e.g. { lat="43.47591", lon="-80.53964", name="Citibank", desc="My College Campus", image="marker.png", meta={color="green", label="C"}} We can make map widget visible/invisible through widget.setvisibility() API Integration of "Directions" with map-widget: [list=*]  

  • Get SOURCE (current) location details like latitude/longitude through phone.location() API
  •    
  • Get DESTINATION location details through mapwidget "onselection" event
  •    
  • Send both SOURCE/DESTINATION details to a web/middleware service (e.g. getDirections) which returns directions resultSet
  •    
  • Display the directions in a segUI
  • [color=red]Note:[/color] Assuming that "getDirections" middleware service is already available

    Vote up!
    0 votes
    Vote down!

    Thanks for the information.

    Regards,
    Kony Developer Forum Support team

    Replied by: Mar 23, 2013 11:11 EDT
    Vote up!
    0 votes
    Vote down!

    Hi,

    I have specified the locationData for the Map widget in the form on the Form Post show event.

    Though I have specified the location data for India Address, it is not showing the pin on that data rather it displays the default location somewhere in South Atlantic Ocean.

    What I am missing if I want to show specific address on the MAP?

    Here is what I have written in Form Post event,

    frmMap.evtMap.locationdata = [{lat :"23.012762", lon :"72.517184", name: "Campus 1", desc: "Near to my Office Campus"}];

    Thanks,
    Vimal

    Replied by: Jun 24, 2013 06:01 EDT
    Vote up!
    0 votes
    Vote down!

    Hi Vimal,
    The Map widget renders a map using the mapping service provided by the platform. So you need to specify locationData for each device depending on the device/platform you are working on.

    Replied by: Jun 24, 2013 06:49 EDT
    Vote up!
    0 votes
    Vote down!

    Hi Vimal,

    I have used the the below code in form preshow and able to get the map as in attached screenshot.

    frmHome.map1.locationdata =[{lat:"23.012762",lon:"72.517184",name:"School",
    desc:"My School Campus",image:"pin.png"}]

    If still any issues then please let us know the Kony plugin details, platform details and if possible provide us the screenshot and sample app.

    Thanks,
    Kony Developer Forum Support team

    Replied by: Jun 24, 2013 07:22 EDT
    Vote up!
    0 votes
    Vote down!

    HI Paramatma ,
    We need to display map description with a link to invoke call api , we have tried using html content with anchor tag, but that is not showing as a link, it just shows the total html content as text.

    PFA screenshot for more details about the requirement.

    Replied by: Aug 29, 2013 03:17 EDT