Permalink
Browse files

jQuery goMap v1.3.2

  • Loading branch information...
1 parent d824268 commit 1e57a4acd47438a9ba52dff214c20a2188608783 @pittss committed Jan 28, 2012
Showing with 109 additions and 0 deletions.
  1. +43 −0 README
  2. +66 −0 js/progressbarcontrol.js
View
43 README
@@ -0,0 +1,43 @@
+# jQuery $.goMap plugin
+
+jQuery $.goMap plugin helps you add google maps to you web site.
+This plugin use javascript google maps api v3.
+
+## Sample
+Simple add
+
+'''html
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+<script type="text/javascript" src="js/jquery.gomap-1.3.2.min.js"></script>
+
+<style>
+#map {
+ width:700px;
+ height:400px;
+}
+</style>
+'''
+
+'''javascript
+$(function() {
+ $("#map").goMap();
+});
+'''
+
+## Supported Browsers
+
+- Internet Explorer 7, and 8+
+- Safari
+- Google Chrome
+- Opera
+- Firefox
+
+## Demos and Documentations
+
+- [jQuery goMap plugin official web site](http://www.pittss.lv/jquery/gomap/)
+
+## Authors
+
+Originaly developed by pittss (Jevgenijs Shtrauss). [www.pittss.lv](http://www.pittss.lv/)
+
View
66 js/progressbarcontrol.js
@@ -0,0 +1,66 @@
+(function($) {
+ $.goMapProgressBar = function(map, options) {
+ var bar = this;
+ bar.map = map;
+ bar.options = options || {};
+
+ bar.init = function() {
+ bar.width = bar.options.width || 176;
+ bar.loadstring = bar.options.loadstring || 'Loading...';
+ bar.operations = 0;
+ bar.current = 0;
+
+ var container = '<div id="geo_progress_container" style="position:absolute;display:none;z-index:1001;width:' + bar.width + 'px;height:20px;border:1px solid #555;background-color:#fff;text-align:left;font-size:0.8em;">'
+ + '<div style="position:absolute;width:100%;border:5px;text-align:center;vertical-align:bottom;" id="geo_progress_text">asd</div>'
+ + '<div style="background-color:green;height:100%;" id="geo_progress"></div>'
+ + '</div>';
+
+ $(bar.map).append(container);
+
+ bar.div_ = $('#geo_progress');
+ bar.text_ = $('#geo_progress_text');
+ bar.container_ = $('#geo_progress_container');
+ };
+
+ bar.start = function() {
+ var operations = $(bar.map).data('goMap').getTmpMarkerCount();
+ bar.operations = operations || 0;
+ bar.current = 0;
+ bar.div_.css({'width':'0%'});
+ bar.text_.css({'color':'#111'}).html(bar.loadstring);
+ bar.container_.css({'display':'block'});
+
+ bar.countDown();
+ };
+
+ bar.updateLoader = function(step) {
+ bar.current = step;
+ if (bar.current > 0) {
+ var percentage_ = Math.ceil((bar.current / bar.operations) * 100);
+ if (percentage_ > 100)
+ percentage_ = 100;
+ bar.div_.css({'width':percentage_ + '%'});
+ bar.text_.html(bar.current + ' / ' + bar.operations);
+ }
+ };
+
+ bar.remove = function() {
+ bar.container_.hide();
+ };
+
+ bar.countDown = function() {
+ var goMap = $(bar.map).data('goMap');
+ var count = goMap.getMarkerCount();
+ if(goMap.getTmpMarkerCount() > count) {
+ bar.updateLoader(count);
+ setTimeout(function() {
+ bar.countDown();
+ }, 200);
+ }
+ else
+ bar.remove();
+ };
+ bar.init();
+ };
+
+})(jQuery);

0 comments on commit 1e57a4a

Please sign in to comment.