There is already one for this. However, I found myself taking a totally different approach than the existing one, such as:
Everything in tag and attributes.
Thus, users don't even need knowledge of JavaScript.
Expose all original Google Maps V3 API to the user.
No hiding, no wrapping or whatsoever.
By doing so, programmers don't need to learn how to use this module.
You only need to know Google Maps V3 API.
If you need to pass in an API key to the javascript, you can set a scope
variable in your controller (e.g. $scope.googleMapsUrl="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE";).
This can be set from a constant value in your app to standardise the API key to pass to google for multiple controllers.
The usual reason why this happens is that the size of the map is changed after the map has been initialized. If you for some reason change the size of the div, you need to trigger the "resize" event and possible recenter the map.
var center = map.getCenter();
google.maps.event.trigger(map, "resize");
map.setCenter(center);
gulp build to build the JavaScript & doc files in the /build folder & run the unit tests.
gulp clean to clean up the repository by removing files and folders from previous build.
gulp test to run the Karma unit test suite.
gulp test:e2e to run the Protractor test suite. For the first test run, you may need to update the protractor webdriver manager. It will show the command on screen if this is required (node_modules/gulp-protractor/node_modules/protractor/bin/webdriver-manager update).
请发表评论