Wednesday, 15 September 2010

jquery - Pass the route path and fence path dynamically for tracking an abject in Here API(GEO FENCING) -



jquery - Pass the route path and fence path dynamically for tracking an abject in Here API(GEO FENCING) -

i using here javascript api explorer tracking moving map object used geo fencing. want pass route path , fence path dynamically hardcoded in code far.

i have tried javascript array.push method i.e. pass value of both dynamically.but helps me append array path both route , fence not loading page loads 1 time , @ time arrays both empty.

var routearr = [52.53805, 13.4205, 52.53765, 13.42156, 52.53811, 13.42188, 52.53862, 13.42232, 52.53929, 13.42283, 52.53921, 13.42333]; var routearr2 = [52.53805, 13.4209, 52.53765, 13.42156, 52.53811, 13.42188, 52.53862, 13.42232, 52.53929, 13.42284, 52.53921, 13.42333]; var route = new nokia.maps.map.polyline( new nokia.maps.geo.strip( routearr, "values lat lng"), { color: "#7fff00", width: 2 } ), imagemarker = new nokia.maps.map.marker( route.path.get(0), { icon: "../../res/markertruck.png", $id: "marker", anchor: {x: 21, y: 41} } ), circle = new nokia.maps.map.polyline( new nokia.maps.geo.strip( routearr2, "values lat lng"), { color: "#000000", width: 2} ), scenecontainer = new nokia.maps.map.container([route, imagemarker, circle]); map.addlistener("displayready", function () { map.objects.add(scenecontainer); map.zoomto(scenecontainer.getboundingbox()); }) ;

i want pass above value of routearr , routearr2 dynamically. have provide route path , fence path before page loads or there way through can pass array both dynamically ?

the mapobject need @ minimum 1 coordinate point , 2 coordinates shape. can init objects routearr1 , routearr2 , alter afterwards routepolyline.set("path", strip); strip new strip.

jquery ajax arrays geofencing here-api

No comments:

Post a Comment