Skip to content

Conversation

slauriere
Copy link
Contributor

  • 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

@slauriere slauriere requested a review from acotiuga June 27, 2018 13:40
@slauriere
Copy link
Contributor Author

slauriere commented Jun 27, 2018

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?

@slauriere slauriere requested a review from vmassol June 27, 2018 13:44
- open OSM directions on click
- make it possible to use % or px for width/height definition
</class>
<property>
<apiKey/>
<apiKey>AIzaSyBuiJnKVxb9XPoSF8Rv8XC6sZBMzidQPF8</apiKey>
Copy link
Contributor

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 &amp;&amp; typeof options == 'object' ) ? options : {};
Copy link
Contributor

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?

Copy link
Contributor Author

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 &amp;&amp; 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];
Copy link
Contributor

@acotiuga acotiuga Jul 6, 2018

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>
Copy link
Contributor

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&gt;&gt;{0}]] or a [[Mapbox access token&gt;&gt;{1}]].
rendering.macro.map.apiKey.googlemaps.invalid=There is no valid Google API key for this macro. Please visit the [[Map Macro section&gt;&gt;{0}]].

Copy link
Contributor

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&gt;&gt;{0}]], or at least it would be cleaner.

<content>{{velocity}}
{{info}}
$services.localization.render('rendering.macro.map.apiKey.info', ['[[', '&gt;&gt;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'])
Copy link
Contributor

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>
Copy link
Contributor

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>
Copy link
Contributor

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>
Copy link
Contributor

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"}}
Copy link
Contributor

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
@acotiuga
Copy link
Contributor

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.

@acotiuga acotiuga merged commit 5fdd395 into master Jul 16, 2018
@acotiuga
Copy link
Contributor

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants