Search Support
-
Maciej SzleminskiSeptember 9, 2016 at 7:44 am #2606
I have a requirement from a customer that when a map is clicked, the geolocation of the clicked point is to be stored in a variable. It used to work earlier (before 4.4.1), but now it doesn’t. The click event doesn’t seem to do anything. If I set it to alert, or console.log, nothing happens.
Here’s how I used to have it set up.
Map onClick was set to @updateLocation
updateLocation was a custom HTML script function with the following body:
function updateLocation(me, location){ var map = page.ui.get("Map1");</p> //Setting the center of the map and adding a marker</p> map.setCenter(location.latitude, location.longitude);</p> map.addMarker();</p> // Printing the Coordinates to the Coordinates field</p> var coordinates= page.ui.get("Coordinates");</p> coordinates.setText("" + parseFloat(location.latitude).toFixed(6) +","+ parseFloat (location.longitude).toFixed(6));</p> }
However, with the current Trial edition of 4.4.3.1 I cannot get the event do anything.
Please help. I am on a tight deadline, I didn’t expect it to stop working all of a sudden and I have a customer presentation early next week where I’m supposed to show this in working order!
SPARK SupportSeptember 12, 2016 at 11:27 am #2621Hello Maciej,
I apologize for the delay in the response.
This issue has been identified as a bug in the Map control and will be addressed in an upcoming Release.
Thank you for bringing this to our attention.
Regards,
Stephen P.
Maciej SzleminskiSeptember 14, 2016 at 3:58 am #2630Please provide ETA until the release which will have this bug fixed so that I can rely this to our customer.
SPARK SupportSeptember 14, 2016 at 7:49 am #2631Hello Maciej,
We normally process a release the first week of each month. This upcoming iteration is scheduled to provide fixes for the API load event and the context variable of the On Click event in the Map control.
Regards,
Stephen P.
Maciej SzleminskiSeptember 15, 2016 at 5:57 am #2641Hi Stephen
Could you please let me know what is the correct handling of the click event, ie. source code that should be used to handle this event, once the bug is fixed?
Have a great day,
MaciekSPARK SupportSeptember 15, 2016 at 9:28 am #2644Hello Maciej,
Once the control has been updated by Development, documentation will be generated based on the publicly available methods and arguments. The documentation is uploaded the same day that the new release is available.
Regards,
Stephen P.
Maciej SzleminskiOctober 4, 2016 at 1:08 pm #2813Has this problem been resolved by your Development?
SPARK SupportOctober 4, 2016 at 4:48 pm #2814Hi Maciej,
We are currently finalizing the October release which should have this issue resolved.
Regards,
Stephen P.
Maciej SzleminskiNovember 14, 2016 at 6:55 am #3059Hi
I tried the newest 4.4.5 CE and the problem either persists or I don’t know how to properly read the map click event data. Please help!
Have a great day,
MaciekSPARK SupportNovember 16, 2016 at 10:51 am #3084Hey Maciej,
You can access the lat and lng of the map location that is clicked through the context variable latLng. So if you wanted to store both lat and lng to variables, you could either create a business object that contains both. (ex: LatLng{lat, lng}). Then add a data control, and bind it to your object. On the click event of the Map control, you would set the variables: dataControl.setData({“lat”: latLng.lat, “lng”: latLng.lng});
Or you could store the variables separately, but you would still need to set them using the context variable. (ex: data1.setData(latLng.lat); data2.setData(latLng.lng);)
Regard,
Erick Q
-
|
You must be logged in to reply to this topic.