-
Notifications
You must be signed in to change notification settings - Fork 6
MAP-16: Enhance the macro to support the display of maps based on OpenStreetMap #9
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
Conversation
slauriere
commented
Jun 27, 2018
- Create two distinct JSX: LeafletMap and GoogleMap
- Add a parameter named "library" for choosing the JavaScript library to be used
- Add a parameter named "tiles" for choosing the tile provider
- Simplify some translation messages
|
Hi @vmassol, Since Alex is off until next week, can I ask you to review this pull request and to merge it into the master branch if it sounds ok to you? |
- open OSM directions on click - make it possible to use % or px for width/height definition
| </class> | ||
| <property> | ||
| <apiKey/> | ||
| <apiKey>AIzaSyBuiJnKVxb9XPoSF8Rv8XC6sZBMzidQPF8</apiKey> |
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 think we shouldn't commit any key here, since it has to be linked to a google account. Is this your key?
| initialize: function(element, options) { | ||
| this.element = $(element); | ||
| // Default option values | ||
| this.options = (options !== undefined && typeof options == 'object' ) ? options : {}; |
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.
The alignment rule you applied doesn't seem to be consistent. Why isn't this line following the rule used in the next ones?
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.
Thank you Alex, indeed, I had overlooked the alignment. It is meant to be fixed it in the latest commit 5233227
| // Default option values | ||
| this.options = (options !== undefined && typeof options == 'object' ) ? options : {}; | ||
| this.options.zoom = this.options.zoom !== undefined ? this.options.zoom : 14; | ||
| this.options.latLng = this.options.latLng !== undefined ? this.options.latLng.split(','): [48.864716, 2.349014]; |
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 would have get rid of these extra whitespaces and keep the lines in max 120 chars.
| <contentUpdateDate>1525702967000</contentUpdateDate> | ||
| <date>1530017451000</date> | ||
| <contentUpdateDate>1530017451000</contentUpdateDate> | ||
| <version>1.1</version> |
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.
These kind of changes should be avoided in commits.
| rendering.macro.map.apiKey.invalid=There is no valid Google API Key for this application. Please visit the {0}Map section{1}. | ||
| rendering.macro.map.apiKey.info=To use the map macro with Google Maps or Mapbox, you must get a [[Google API key>>{0}]] or a [[Mapbox access token>>{1}]]. | ||
| rendering.macro.map.apiKey.googlemaps.invalid=There is no valid Google API key for this macro. Please visit the [[Map Macro section>>{0}]]. | ||
|
|
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 think I prefer the old version for translations (i.e. devs to take care of any kind of syntax: HTML, wiki). Imagine a contributor going to https://l10n.xwiki.org/projects/xwiki-contrib/map-macro/ in order to help. I think it would be easier to translate something like Please visit the {0}Map section{1} than Please visit the [[Map Macro section>>{0}]], or at least it would be cleaner.
| <content>{{velocity}} | ||
| {{info}} | ||
| $services.localization.render('rendering.macro.map.apiKey.info', ['[[', '>>path:https://developers.google.com/maps/documentation/javascript/get-api-key]]']) | ||
| $services.localization.render('rendering.macro.map.apiKey.info', ['path:https://developers.google.com/maps/documentation/javascript/get-api-key', 'path:https://www.mapbox.com/account/access-tokens']) |
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.
See my comment on the translation, at the end of PR.
| <date>1525702990000</date> | ||
| <contentUpdateDate>1525702967000</contentUpdateDate> | ||
| <date>1530017450000</date> | ||
| <contentUpdateDate>1530017450000</contentUpdateDate> |
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, we avoid to commit date changes.
| <date>1525702990000</date> | ||
| <contentUpdateDate>1525702967000</contentUpdateDate> | ||
| <date>1530017451000</date> | ||
| <contentUpdateDate>1530017451000</contentUpdateDate> |
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.
And here ...
| <date>1525702990000</date> | ||
| <contentUpdateDate>1525702967000</contentUpdateDate> | ||
| <date>1530017450000</date> | ||
| <contentUpdateDate>1530017450000</contentUpdateDate> |
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.
And here.
…nStreetMap - fix formatting issue in MapMacro/Code/LeafletMap - reverted the l10n formatting for parameters - remove the Google Maps API key - restore original values of fields "creationDate", "date", "contentUpdateDate"
| <syntaxId>xwiki/2.1</syntaxId> | ||
| <hidden>true</hidden> | ||
| <content>{{velocity}} | ||
| <content>{{velocity wiki="true"}} |
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 not needed, as the default value for the wiki parameter is true. See: https://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Macro.
- remove unnecessary parameter "wiki=true" in the configuration
…nStreetMap - update version to "2.0-snapshot" to reflect a change in the default: from Google Maps to OSM
|
In the mean time, some small changes were done in this macro, by some other dev and this PR has conflicts that must be resolved. |
…that
these properties can either be in pixels or percent.
the macro is installed
|
Thanks for your contribution! |