-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/marker click event #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| <caption>API key</caption> | ||
| <category>General</category> | ||
| <description>The Google Maps Javascript API v3 does not require an API key to function correctly. However, Google strongly encourages you to load the Maps API using an APIs key</description> | ||
| <description>The Google Maps Javascript API v3 requires an API key.</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the full stop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the DEPRECATED older version of Google Maps
src/GoogleMaps.xml
Outdated
| <property key="onClickMicroflow" type="microflow" required="false" entityProperty="locationsEntity"> | ||
| <caption>On click microflow</caption> | ||
| <category>Markers</category> | ||
| <description>The microflow that will be executed when a marker is click </description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'click' should be 'clicked'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/GoogleMaps.xml
Outdated
| <property key="onClickNanoflow" type="nanoflow" required="false" entityProperty="locationsEntity"> | ||
| <caption>On click nanoflow</caption> | ||
| <category>Markers</category> | ||
| <description>The nanoflow that will be executed when a marker is click </description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/GoogleMaps.xml
Outdated
| <property key="page" type="form" required="false"> | ||
| <caption>Page</caption> | ||
| <category>Markers</category> | ||
| <description>The page that will be opened when a marker is click</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/components/GoogleMapContainer.ts
Outdated
| return errorMessage; | ||
| } | ||
|
|
||
| private executeOnClickAction = (data: LatLng) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this function do creates an object 'and' also executes an action, Function should do one thing. separate this => createOnclickObject , executeOnClick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| _args?: { | ||
| location?: "content" | "popup" | "modal", | ||
| domNode?: HTMLElement, | ||
| location?: "content" | "popup" | "modal" | "node", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is node used anywhere or just in code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added node because the mendix client typings API openForm was updated and argument location changed to "content" | "popup" | "modal" | "node"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
src/components/GoogleMapContainer.ts
Outdated
| error: error => window.mx.ui.error(`Error while executing the on change nanoflow: ${error.message}`) | ||
| }); | ||
| } else if (onClickEvent === "showPage" && page) { | ||
| context.setContext(object.getEntity(), object.getGuid()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the line after creating the context or in the new function after separating
const context = new mendix.lib.MxContext();
context.setContext(object.getEntity(), object.getGuid());
src/components/GoogleMapContainer.ts
Outdated
| public static validateProps(props: GoogleMapContainerProps): string { | ||
| let errorMessage = ""; | ||
| if (props.onClickEvent === "callMicroflow" && !props.onClickMicroflow) { | ||
| errorMessage = "A 'Microflow' is required for 'Markers' 'Call a microflow'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A 'Microflow' is required for on click 'Marker' event 'Call a Microflow'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/components/GoogleMapContainer.ts
Outdated
| } else if (props.onClickEvent === "callNanoflow" && !props.onClickNanoflow.nanoflow) { | ||
| errorMessage = "A 'Nanoflow' is required for 'Markers' 'Call a nanoflow'"; | ||
| } else if (props.onClickEvent === "showPage" && !props.page) { | ||
| errorMessage = "A 'Page' is required for 'Markers' 'Show a page'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/components/GoogleMapContainer.ts
Outdated
| if (props.onClickEvent === "callMicroflow" && !props.onClickMicroflow) { | ||
| errorMessage = "A 'Microflow' is required for 'Markers' 'Call a microflow'"; | ||
| } else if (props.onClickEvent === "callNanoflow" && !props.onClickNanoflow.nanoflow) { | ||
| errorMessage = "A 'Nanoflow' is required for 'Markers' 'Call a nanoflow'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
1d11feb to
522d43e
Compare
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
==========================================
- Coverage 82.5% 81.59% -0.91%
==========================================
Files 3 3
Lines 160 163 +3
Branches 42 43 +1
==========================================
+ Hits 132 133 +1
- Misses 28 30 +2
Continue to review full report at Codecov.
|
522d43e to
e1518d9
Compare
3416a75 to
179806e
Compare
djkwagala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When onClick === "DoNothing" atleast we should have a onhover to show the coordinates. (this is the same case with charts.
This option can be disabled via xml-configs
This is to deal with situations where the google-maps interpreted the location via its "Address" and the coordinates were missing or "0,0".
8ebc13a to
f1f3dab
Compare
f1f3dab to
2ee9c24
Compare
Uh oh!
There was an error while loading. Please reload this page.