The simulator helps in the development phase of projects. It lets you simulate a user on a certain location or a moving user without being at those places in the real world.
Usage
First you need to include the simulator library
<script src="js/geo_position_js_simulator.js" type="text/javascript" charset="utf-8"></script>
then create an array whose elements are simple hashs with latitude/longitude and the duration of the stay in seconds. Example: if you have 2 those entries, the second entry gets activated as the current location after the duration of the first one has expired.
locations=new Array();
locations.push({ coords:{latitude:41.399856290690956,longitude:2.1961069107055664},duration:5000 });
locations.push({ coords:{latitude:41.400634242252046,longitude:2.1971797943115234},duration:5000 });
locations.push({ coords:{latitude:41.40124586762545,longitude:2.197995185852051},duration:5000 }); Lastly initialize the simulator and do that before you initialize the toolkit.
geo_position_js_simulator.init(locations);
Check it out in action:
Hi Stan, My name is manuel & currently am jobless.
Recently had an application in mind, & trying to run it. however, facing a few problems.
I was looking to integrate the the moving user example with a dynamic location call module. This module basically returns the current Latt & Long of a user, ie, dynamic.(say when u enter a mobile number)
Now the problem am facing is that, the example as posted works fine in HTML with static data, but as i work on SOLARIS OS, & Tomcat as, Web Server I saved the same HTML page, as JSP with a few changes, as shown below :-
function push_data(){
locations.push({coords:{latitude:final_textTrimmed_Latt_onlyValue,longitude:final_textTrimmed_Long_onlyValue},duration:2000 });
}
& call this function right in the JSP scriplet.
The function gets called properly, however, this is where the problem starts,as it only takes the last location & displays onto the MAP & the locations are not shown, hence i can always see just the last location, ie, just one marker on the MAP.
Tried try to understand as the basic flow, as to the STACK use, show_location(p, giving alerts at various points in geo_position_js_simulator.js, and the complete array goes in here properly, but when der is frequent call between geo.js & geo_position_js_simulator.js, some where the data is getting lost.
Would be greatful if you can guide me through so as to confirm my understanding of the flow of the program.
Not sure if my comments are clear Stan, my appologies
This is cool! do we get some updates?
this is deprecated. why still using this library