From 277b0c5f5f7d2a53ac32aa1477a7eb9afa61d3eb Mon Sep 17 00:00:00 2001 From: Nicholas Bering Date: Fri, 14 Apr 2017 16:29:19 -0400 Subject: [PATCH] [docs] Add map example to old docs page to aid development. --- index.html | 6 ++++-- partials/map.html | 5 +++++ partials/map.js | 22 ++++++++++++++++++++++ sample.js | 11 +++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 partials/map.html create mode 100644 partials/map.js diff --git a/index.html b/index.html index 305fe0b..2a3c2f5 100644 --- a/index.html +++ b/index.html @@ -41,6 +41,7 @@
  • Line chart
  • Annotation chart
  • Gauge chart
  • +
  • Map Chart
  • Mutli charts sample
  • @@ -68,13 +69,14 @@

    AngularJs Google Chart Tools directive

    - - + + + diff --git a/partials/map.html b/partials/map.html new file mode 100644 index 0000000..46906c9 --- /dev/null +++ b/partials/map.html @@ -0,0 +1,5 @@ +

    Map

    + +
    + + diff --git a/partials/map.js b/partials/map.js new file mode 100644 index 0000000..6fef123 --- /dev/null +++ b/partials/map.js @@ -0,0 +1,22 @@ +(function(){ + angular.module('google-chart-sample') + .controller("MapChartCtrl", MapChartCtrl); + + MapChartCtrl.$inject = ["$scope"]; + function MapChartCtrl($scope){ + $scope.myMapChart = { + type: "Map", + data: [ + ["Lat", "Long", "Name"], + [37.4232, -122.0853, 'Work'], + [37.4289, -122.1697, 'University'], + [37.6153, -122.3900, 'Airport'], + [37.4422, -122.1731, 'Shopping'] + ], + options: { + showTooltop: true, + showInfoWindow: true + } + } + } +})(); diff --git a/sample.js b/sample.js index 4084dfe..7dff33c 100644 --- a/sample.js +++ b/sample.js @@ -15,6 +15,10 @@ angular.module("google-chart-sample", ["ngRoute", "googlechart"]).config(['$rout templateUrl: 'partials/gauge.html', controller: 'GaugeChartCtrl' }). + when('/map', { + templateUrl: 'partials/map.html', + controller: 'MapChartCtrl' + }). when('/generic/:chartType', { templateUrl: 'partials/generic.html', controller: 'GenericChartCtrl' @@ -22,6 +26,13 @@ angular.module("google-chart-sample", ["ngRoute", "googlechart"]).config(['$rout otherwise({ redirectTo: '/fat' }); + }]) + .config(["agcLibraryLoaderProvider", function(agcLibraryLoaderProvider){ + agcLibraryLoaderProvider.setLoader("gstatic"); + }]) + .config(["agcGstaticLoaderProvider", function(gstaticProvider){ + gstaticProvider.addPackage("map"); + //gstaticProvider.setOption("mapsApiKey", "INSERT YOUR KEY HERE"); }]);/*.value('googleChartApiConfig', { version: '1', optionalSettings: {