jeffreykemp / jk64-plugin-reportmap

Report Google Map APEX Plugin
https://jeffreykemp.github.io/jk64-plugin-reportmap/
MIT License
42 stars 16 forks source link

Not able to plot the lat and Long from reportmap plugin #91

Closed Umashankar-S closed 4 years ago

Umashankar-S commented 4 years ago

Describe the bug Am using your plugin https://github.com/jeffreykemp/jk64-plugin-reportmap and was able to perform gelocate using steps in your demo app : https://apex.oracle.com/pls/apex/f?p=15181:12:12071374002257::::: .

But am not able to read the lat and long values using this.data.lat or this.data.long .. Is this known issue if we miss anything .. All we did is load the plugin and create page with Region based on plugin . And created one page item CENTRE and Button Geolocate . And respective dynamic actions. Button geolocate works but Display only Page item "CENTRE" doesn't gets populated with lat, long ..

To Reproduce Steps to reproduce the behavior:

  1. Login to the apex app and perform gelocate it works perfectly
  2. Now when I click any place in map or after gelocate button press , the lat,long displays in the map but doesn't populates P12_Centre Page item .

Region Dynamic action of set value with JS expression " this.data.lat+" "+this.data.lng" is used to set the value .

Console log shows below error ..

Uncaught TypeError: Cannot read property 'lat' of undefined at Object.attribute05 (f?p=121:8:515659075993223::NO::::175) at Object.a.setValue (desktop_all.min.js?v=19.2.0.00.18:22) at Object.da.doAction (desktop_all.min.js?v=19.2.0.00.18:21) at Object.da.doActions (desktop_all.min.js?v=19.2.0.00.18:21) at HTMLDivElement. (desktop_all.min.js?v=19.2.0.00.18:21) at Function.each (desktop_all.min.js?v=19.2.0.00.18:2) at k.fn.init.each (desktop_all.min.js?v=19.2.0.00.18:2) at Object.da.actions (desktop_all.min.js?v=19.2.0.00.18:21) at Object. (desktop_all.min.js?v=19.2.0.00.18:21) at Function.each (desktop_all.min.js?v=19.2.0.00.18:2) Expected behavior P12_Centre Page Item should show the lat,long

Screenshots If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

Plugin Attributes Run the page in Debug mode, copy the attributes from the console log here.

Debug mode console log

0.07009 | 0.00001 | attribute_02: | 4 | 0% 0.07010 | 0.00002 | attribute_03: | 4 | 0% 0.07011 | 0.00001 | attribute_04: | 4 | 0% 0.07013 | 0.00001 | attribute_05: | 4 | 0% 0.07014 | 0.00002 | attribute_06: | 4 | 0% 0.07016 | 0.00002 | attribute_07: 10000 | 4 | 0% 0.07017 | 0.00001 | attribute_08: | 4 | 0% 0.07019 | 0.00001 | attribute_09: | 4 | 0% 0.07020 | 0.00001 | attribute_10: | 4 | 0% 0.07021 | 0.00001 | attribute_11: | 4 | 0% 0.07023 | 0.00001 | attribute_12: | 4 | 0% 0.07024 | 0.00001 | attribute_13: | 4 | 0% 0.07026 | 0.00001 | attribute_14: | 4 | 0% 0.07027 | 0.00001 | attribute_15: | 4 | 0% 0.07028 | 0.00002 | Region meta data: | 4 | 0% 0.07030 | 0.00002 | id: 43613866218092148 | 4 | 0% 0.07032 | 0.00002 | static_id: mymap | 4 | 0% 0.07033 | 0.00002 | name: New | 4 | 0% 0.07035 | 0.00004 | type: PLUGIN_COM.JK64.REPORT_GOOGLE_MAP_R1 | 4 | 0% 0.07038 | 0.00002 | source: | 4 | 0% 0.07040 | 0.00002 | ajax_items_to_submit: | 4 | 0% 0.07041 | 0.00004 | fetched_rows: 15 | 4 | 0% 0.07046 | 0.00002 | escape_output: null | 4 | 0% 0.07047 | 0.00001 | no_data_found_message: No Data Found | 4 | 0% 0.07049 | 0.00002 | master_region_id: | 4 | 0% 0.07050 | 0.00002 | master_region_static_id: | 4 | 0% 0.07052 | 0.00002 | attribute_01: 400 | 4 | 0% 0.07053 | 0.00001 | attribute_02: PINS | 4 | 0% 0.07055 | 0.00002 | attribute_03: 13 | 4 | 0% 0.07056 | 0.00001 | attribute_04: PAN_ON_CLICK:PAN_ALLOWED:ZOOM_ALLOWED:GEOJSON_DRAGDROP | 4 | 0% 0.07057 | 0.00001 | attribute_05: | 4 | 0% 0.07059 | 0.00001 | attribute_06: | 4 | 0% 0.07060 | 0.00001 | attribute_07: | 4 | 0% 0.07062 | 0.00002 | attribute_08: | 4 | 0% 0.07063 | 0.00001 | attribute_09: | 4 | 0% 0.07065 | 0.00001 | attribute_10: | 4 | 0% 0.07066 | 0.00001 | attribute_11: | 4 | 0% 0.07067 | 0.00001 | attribute_12: | 4 | 0% 0.07069 | 0.00001 | attribute_13: | 4 | 0% 0.07070 | 0.00001 | attribute_14: | 4 | 0% 0.07072 | 0.00001 | attribute_15: | 4 | 0% 0.07073 | 0.00001 | attribute_16: | 4 | 0% 0.07074 | 0.00002 | attribute_17: | 4 | 0% 0.07076 | 0.00001 | attribute_18: | 4 | 0% 0.07078 | 0.00001 | attribute_19: | 4 | 0% 0.07079 | 0.00001 | attribute_20: | 4 | 0% 0.07080 | 0.00002 | attribute_21: | 4 | 0% 0.07082 | 0.00001 | attribute_22: ROADMAP | 4 | 0% 0.07083 | 0.00001 | attribute_23: | 4 | 0% 0.07085 | 0.00002 | attribute_24: Y | 4 | 0% 0.07086 | 0.00002 | attribute_25: auto | 4 | 0% 0.07088 | 0.00002 | init_javascript_code: | 4 | 0% 0.07089 | 0.00003 | is_printer_friendly: false | 4 | 0% 0.07092 | 0.00068 | map region: mymap | 4 | 1% 0.07160 | 0.00034 | map options: {"regionId":"mymap","expectData":false,"clickZoomLevel":13,"dragDropGeoJSON":true,"noDataMessage":"No Data Found","ajaxIdentifier":"_HrGDUO3vK4N6bKczwndkHtwJFFAzaVim_MCff4Aoh8","pluginFilePrefix":"r\u002Fappsusr1\u002F121\u002Ffiles\u002Fplugin\u002F159440697219205281\u002Fv413\u002F"}

======================================================================== Additional context N/A just following the instructions as per the plugin

jeffreykemp commented 4 years ago

Hi, please specify what Event your set value Dynamic Action is responding to.

Umashankar-S commented 4 years ago

Hi, please specify what Event your set value Dynamic Action is responding to.

Hi ,

Thanks for your response , Have tried placing dynamic actions in two places [ not simultaneously ] :

  1. Dynamic action of Gelocate Button click OR
  2. Dynamic Action on Region [ After Refresh or Click ]

Dynamic Action : Set Value -> Java Script expression -> this.data.lat+" "+this.data.lng

jeffreykemp commented 4 years ago

Those events (button click and after refresh / click) are events generated by APEX and are not part of the plugin.

To respond to a plugin event you must create a dynamic action on the specific event you're interested in, in this case the geolocate event.

More info: https://github.com/jeffreykemp/jk64-plugin-reportmap/wiki/Plugin-Events-Reference

Umashankar-S commented 4 years ago

Thanks a lot ! It resolved the issue .