added admin interface
This commit is contained in:
1 parent
9adf18c7b9
commit
a25104fadc
3496 files changed
+280326
-7
No files matched your search
+99
@@ -0,0 +1,99 @@
|
||||
/*global module:false*/
|
||||
module.exports = function(grunt) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
|
||||
meta : {
|
||||
banner : '/*!\n' +
|
||||
' * GMaps.js v<%= pkg.version %>\n' +
|
||||
' * <%= pkg.homepage %>\n' +
|
||||
' *\n' +
|
||||
' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author %>\n' +
|
||||
' * Released under the <%= pkg.license %> License.\n' +
|
||||
' */\n\n'
|
||||
},
|
||||
|
||||
concat: {
|
||||
options: {
|
||||
banner: '<%= meta.banner %>'
|
||||
},
|
||||
dist: {
|
||||
src: [
|
||||
'lib/gmaps.core.js',
|
||||
'lib/gmaps.controls.js',
|
||||
'lib/gmaps.markers.js',
|
||||
'lib/gmaps.overlays.js',
|
||||
'lib/gmaps.geometry.js',
|
||||
'lib/gmaps.layers.js',
|
||||
'lib/gmaps.routes.js',
|
||||
'lib/gmaps.geofences.js',
|
||||
'lib/gmaps.static.js',
|
||||
'lib/gmaps.map_types.js',
|
||||
'lib/gmaps.styles.js',
|
||||
'lib/gmaps.streetview.js',
|
||||
'lib/gmaps.events.js',
|
||||
'lib/gmaps.utils.js',
|
||||
'lib/gmaps.native_extensions.js'
|
||||
],
|
||||
dest: 'gmaps.js'
|
||||
}
|
||||
},
|
||||
|
||||
jasmine: {
|
||||
options: {
|
||||
template: 'test/template/jasmine-gmaps.html',
|
||||
specs: 'test/spec/*.js',
|
||||
vendor: 'http://maps.google.com/maps/api/js?sensor=true',
|
||||
styles: 'test/style.css'
|
||||
},
|
||||
src : '<%= concat.dist.src %>'
|
||||
},
|
||||
|
||||
watch : {
|
||||
files : '<%= concat.dist.src %>',
|
||||
tasks : 'default'
|
||||
},
|
||||
|
||||
jshint : {
|
||||
all : ['Gruntfile.js']
|
||||
},
|
||||
|
||||
uglify : {
|
||||
options : {
|
||||
sourceMap : true
|
||||
},
|
||||
all : {
|
||||
files: {
|
||||
'gmaps.min.js': [ 'gmaps.js' ]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
umd : {
|
||||
all : {
|
||||
src : 'gmaps.js',
|
||||
objectToExport : 'GMaps',
|
||||
globalAlias : 'GMaps',
|
||||
template : 'umd.hbs',
|
||||
deps: {
|
||||
amd: ['jquery', 'googlemaps!']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-jasmine');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-umd');
|
||||
|
||||
grunt.registerTask('test', ['jshint', 'jasmine']);
|
||||
grunt.registerTask('default', ['test', 'concat', 'umd', 'uglify']);
|
||||
};
|
||||
+2409
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,2 @@
|
||||
"use strict";!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(["jquery","googlemaps!"],b):a.GMaps=b()}(this,function(){var a=function(a,b){var c;if(a===b)return a;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a},b=function(a,b){var c,d=Array.prototype.slice.call(arguments,2),e=[],f=a.length;if(Array.prototype.map&&a.map===Array.prototype.map)e=Array.prototype.map.call(a,function(a){var c=d.slice(0);return c.splice(0,0,a),b.apply(this,c)});else for(c=0;f>c;c++)callback_params=d,callback_params.splice(0,0,a[c]),e.push(b.apply(this,callback_params));return e},c=function(a){var b,c=[];for(b=0;b<a.length;b++)c=c.concat(a[b]);return c},d=function(a,b){var c=a[0],d=a[1];return b&&(c=a[1],d=a[0]),new google.maps.LatLng(c,d)},f=function(a,b){var c;for(c=0;c<a.length;c++)a[c]instanceof google.maps.LatLng||(a[c].length>0&&"object"==typeof a[c][0]?a[c]=f(a[c],b):a[c]=d(a[c],b));return a},g=function(a,b){var c,d=a.replace(".","");return c="jQuery"in this&&b?$("."+d,b)[0]:document.getElementsByClassName(d)[0]},h=function(a,b){var c,a=a.replace("#","");return c="jQuery"in window&&b?$("#"+a,b)[0]:document.getElementById(a)},i=function(a){var b=0,c=0;if(a.offsetParent)do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent);return[b,c]},j=function(b){var c=document,d=function(b){if("object"!=typeof window.google||!window.google.maps)return"object"==typeof window.console&&window.console.error&&console.error("Google Maps API is required. Please register the following JavaScript library https://maps.googleapis.com/maps/api/js."),function(){};if(!this)return new d(b);b.zoom=b.zoom||15,b.mapType=b.mapType||"roadmap";var e,f=function(a,b){return void 0===a?b:a},j=this,k=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","idle","maptypeid_changed","projection_changed","resize","tilesloaded","zoom_changed"],l=["mousemove","mouseout","mouseover"],m=["el","lat","lng","mapType","width","height","markerClusterer","enableNewStyle"],n=b.el||b.div,o=b.markerClusterer,p=google.maps.MapTypeId[b.mapType.toUpperCase()],q=new google.maps.LatLng(b.lat,b.lng),r=f(b.zoomControl,!0),s=b.zoomControlOpt||{style:"DEFAULT",position:"TOP_LEFT"},t=s.style||"DEFAULT",u=s.position||"TOP_LEFT",v=f(b.panControl,!0),w=f(b.mapTypeControl,!0),x=f(b.scaleControl,!0),y=f(b.streetViewControl,!0),z=f(z,!0),A={},B={zoom:this.zoom,center:q,mapTypeId:p},C={panControl:v,zoomControl:r,zoomControlOptions:{style:google.maps.ZoomControlStyle[t],position:google.maps.ControlPosition[u]},mapTypeControl:w,scaleControl:x,streetViewControl:y,overviewMapControl:z};if("string"==typeof b.el||"string"==typeof b.div?n.indexOf("#")>-1?this.el=h(n,b.context):this.el=g.apply(this,[n,b.context]):this.el=n,"undefined"==typeof this.el||null===this.el)throw"No element defined.";for(window.context_menu=window.context_menu||{},window.context_menu[j.el.id]={},this.controls=[],this.overlays=[],this.layers=[],this.singleLayers={},this.markers=[],this.polylines=[],this.routes=[],this.polygons=[],this.infoWindow=null,this.overlay_el=null,this.zoom=b.zoom,this.registered_events={},this.el.style.width=b.width||this.el.scrollWidth||this.el.offsetWidth,this.el.style.height=b.height||this.el.scrollHeight||this.el.offsetHeight,google.maps.visualRefresh=b.enableNewStyle,e=0;e<m.length;e++)delete b[m[e]];for(1!=b.disableDefaultUI&&(B=a(B,C)),A=a(B,b),e=0;e<k.length;e++)delete A[k[e]];for(e=0;e<l.length;e++)delete A[l[e]];this.map=new google.maps.Map(this.el,A),o&&(this.markerClusterer=o.apply(this,[this.map]));var D=function(a,b){var c="",d=window.context_menu[j.el.id][a];for(var e in d)if(d.hasOwnProperty(e)){var f=d[e];c+='<li><a id="'+a+"_"+e+'" href="javascript:void(0);">'+f.title+"</a></li>"}if(h("gmaps_context_menu")){var g=h("gmaps_context_menu");g.innerHTML=c;var e,k=g.getElementsByTagName("a"),l=k.length;for(e=0;l>e;e++){var m=k[e],n=function(c){c.preventDefault(),d[this.id.replace(a+"_","")].action.apply(j,[b]),j.hideContextMenu()};google.maps.event.clearListeners(m,"click"),google.maps.event.addDomListenerOnce(m,"click",n,!1)}var o=i.apply(this,[j.el]),p=o[0]+b.pixel.x-15,q=o[1]+b.pixel.y-15;g.style.left=p+"px",g.style.top=q+"px"}};this.buildContextMenu=function(a,b){if("marker"===a){b.pixel={};var c=new google.maps.OverlayView;c.setMap(j.map),c.draw=function(){var d=c.getProjection(),e=b.marker.getPosition();b.pixel=d.fromLatLngToContainerPixel(e),D(a,b)}}else D(a,b);var d=h("gmaps_context_menu");setTimeout(function(){d.style.display="block"},0)},this.setContextMenu=function(a){window.context_menu[j.el.id][a.control]={};var b,d=c.createElement("ul");for(b in a.options)if(a.options.hasOwnProperty(b)){var e=a.options[b];window.context_menu[j.el.id][a.control][e.name]={title:e.title,action:e.action}}d.id="gmaps_context_menu",d.style.display="none",d.style.position="absolute",d.style.minWidth="100px",d.style.background="white",d.style.listStyle="none",d.style.padding="8px",d.style.boxShadow="2px 2px 6px #ccc",Line truncated
|
||||
//# sourceMappingURL=gmaps.min.js.map
|
||||
Reference in new issue
Block a user