Skip to content

Commit 2fc4e9c

Browse files
authored
Merge feature/map-style
Add map style and custom marker images
2 parents cae0959 + 1b4977c commit 2fc4e9c

32 files changed

Lines changed: 2872 additions & 1618 deletions

README.md

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Dependency Status](https://david-dm.org/mendixlabs/google-maps.svg)](https://david-dm.org/mendixlabs/google-maps)
33
[![Dev Dependency Status](https://david-dm.org/mendixlabs/google-maps.svg#info=devDependencies)](https://david-dm.org/mendixlabs/google-maps#info=devDependencies)
44
[![codecov](https://codecov.io/gh/mendixlabs/google-maps/branch/master/graph/badge.svg)](https://codecov.io/gh/mendixlabs/google-maps)
5-
![badge](https://img.shields.io/badge/mendix-7.6.0-green.svg)
5+
![badge](https://img.shields.io/badge/mendix-7.9.0-green.svg)
66

77
# Google Maps
88
* Show locations on google maps
@@ -12,6 +12,8 @@
1212
* Show location on a map based on an coordinate
1313
* Show list of both addresses and coordinates on the map
1414
* Data sources Context, Static, XPath or Microflow
15+
* Customize the display of the marker. If the marker can not be found from the custom markers. The widget will use
16+
the specified custom markers else it will use the widget bundled marker.
1517

1618
## Limitations
1719
Context and static datasource are Offline capable with Mendix data, however still need to be online to see the map.
@@ -21,7 +23,7 @@ from Google applies, especially for geocoding. We even advise geocoding your loc
2123
Mendix application and store them for later use as coordinates on the widget.
2224

2325
## Dependencies
24-
Mendix 7.4
26+
Mendix 7.9.0
2527

2628
## How it Works
2729
When displaying locations, the widget will prioritize coordinates over addresses.In the event that
@@ -52,37 +54,18 @@ When the default center is not specified, the map will use the bounds center
5254
- On the `Data source` option of the `Data source` tab, select the `Microflow` option.
5355
- Specify the `Location entity` and the `Microflow` to retrieve the Map `locations` from (both required).
5456

57+
### Appearance
58+
- It is used to configure how the map responsively looks in relation to the container it is placed in.
59+
60+
### Custom markers
61+
- It is used to configure how the marker icon should be look. Due to the limitation of Mendix. The markers are created
62+
based on enumeration. An enumeration containing the name and caption of the markers should be created within your project
63+
and that enumeration assigned to the `Location entity`. From the `Custom markers` tab, the enumeration key and image is
64+
then specified in the `Marker images`
65+
5566
## Issues, suggestions and feature requests
5667
Please report issues at [https://github.com/mendixlabs/google-maps/issues](https://github.com/mendixlabs/google-maps/issues).
5768

5869

59-
## Development
60-
Prerequisite: Install git, node package manager, webpack CLI, grunt CLI, Karma CLI
61-
62-
To contribute, fork and clone.
63-
64-
git clone https://github.com/mendixlabs/google-maps.git
65-
66-
The code is in typescript. Use a typescript IDE of your choice, like Visual Studio Code or WebStorm.
67-
68-
To set up the development environment, run:
69-
70-
npm install
71-
72-
Create a folder named dist in the project root.
73-
74-
Create a Mendix test project in the dist folder and rename its root folder to MxTestProject. Changes to the widget code shall be automatically pushed to this test project. Or get the test project from [https://github.com/mendixlabs/google-maps/releases/latest](https://github.com/mendixlabs/google-maps/releases/latest)
75-
76-
dist/MxTestProject
77-
78-
To automatically compile, bundle and push code changes to the running test project, run:
79-
80-
grunt
81-
82-
To run the project unit tests with code coverage, results can be found at dist/testresults/coverage/index.html, run:
83-
84-
npm test
85-
86-
or run the test continuously during development:
87-
88-
karma start
70+
## Development and contribution
71+
Please follow [development guide](/development.md).

development.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Development and contribution
2+
Prerequisite: Install git, node package manager, webpack CLI, grunt CLI, Karma CLI
3+
4+
To contribute, fork and clone.
5+
6+
> git clone https://github.com/mendixlabs/google-maps.git
7+
8+
The code is in typescript. Use a typescript IDE of your choice, like Visual Studio Code or WebStorm.
9+
10+
To set up the development environment, run:
11+
12+
> npm install
13+
14+
Create a folder named `dist` in the project root.
15+
16+
Create a Mendix test project in the dist folder and rename its root folder to `dist/MxTestProject`. Changes to the widget code shall be automatically pushed to this test project.
17+
Or get the test project from [https://github.com/mendixlabs/google-maps/releases/latest](https://github.com/mendixlabs/google-maps/releases/latest)
18+
19+
To automatically compile, bundle and push code changes to the running test project, run:
20+
21+
> npm start
22+
23+
To run the project unit tests with code coverage, results can be found at `dist/testresults/coverage/index.html`, run:
24+
25+
> npm run test:unit
26+
27+
Run the unit test continuously during development:
28+
29+
> npm run test:dev
30+
31+
Run the end to end test during development:
32+
33+
> npm run test:e2e:dev
34+
35+
## Scripts
36+
While developing, you will probably rely mostly on `npm start`; however, there are additional scripts at your disposal:
37+
38+
|`npm run <script>`|Description|
39+
|------------------|-----------|
40+
|`start`|Build the project and monitor source and config for changes and rebuild.|
41+
|`test`|Runs lint, build, unit tests with Karma and generates a coverage report, deploy and run e2e test|
42+
|`test:dev`|Runs Karma and watches for changes to re-run tests; does not generate coverage reports.|
43+
|`test:unit`|Runs unit tests with Karma and generates a coverage report.|
44+
|`test:e2e`|Runs end 2 end tests with remote.|
45+
|`test:e2e:dev`|Runs end 2 end tests with locally on localhost:8080|
46+
|`deploy`|Use latest widget build to update the Mendix project update the application to Mendix node.|
47+
|`build:prod`|Build widget optimized for production|
48+
|`build:dev`|Build widget optimized for debugging.|
49+
|`lint`|Lint all `.js` files.|
50+
|`lint:fix`|Lint and fix all `.ts` files.|
51+
52+
# CI and remote testing
53+
To enable the continues integration services.
54+
Copy the `node_modules/mendix-widget-build-script/dist/localSettings.js`
55+
to your project root, and update the settings to run the update deployment from local source.
56+
57+
**Do not forget** to exclude this file in the `.gitignore` as it contains sensitive data.
58+
```
59+
exports.settings = {
60+
appName: "appName",
61+
key: "xxxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxx",
62+
password: "secret",
63+
projectId: "xxxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxx",
64+
user: "ci@example.com"
65+
};
66+
```
67+
68+
More information about the [Mendix widget build script](https://github.com/FlockOfBirds/mendix-widget-build-script).

karma.conf.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ Object.assign(webpackConfig, {
88
"react/lib/ReactContext",
99
"react/addons",
1010
"jsdom",
11-
"dojo/_base/declare",
12-
"mxui/widget/_WidgetBase"
13-
]
11+
/^mxui\/|^mendix\/|^dojo\/|^dijit\//
12+
],
1413
});
1514

1615
module.exports = function(config) {

0 commit comments

Comments
 (0)