diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..291ec0c --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2012 Dimitris Krestos + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..998c63e --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# MapIt + +An easy way to embed google maps in your site + +## Copyright and license + +Copyright 2013 Dimitris Krestos + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +[http://www.apache.org/licenses/LICENSE-2.0][2] + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + [1]: https://github.com/vdw/MapIt/ + [2]: http://www.apache.org/licenses/LICENSE-2.0 + [3]: https://github.com/vdw/MapIt/wiki \ No newline at end of file diff --git a/demo/images/marker.png b/demo/images/marker.png new file mode 100644 index 0000000..ea900eb Binary files /dev/null and b/demo/images/marker.png differ diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..b239b8e --- /dev/null +++ b/demo/index.html @@ -0,0 +1,47 @@ + + + + + MapIt | An easy way to embed google maps in your site. + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/demo/javascripts/initializers.js b/demo/javascripts/initializers.js new file mode 100644 index 0000000..ddf1b72 --- /dev/null +++ b/demo/javascripts/initializers.js @@ -0,0 +1,6 @@ +// Run javascript after DOM is initialized +$(document).ready(function() { + + $('#map_canvas').mapit(); + +}); \ No newline at end of file diff --git a/demo/javascripts/vendor/jquery.mapit.min.js b/demo/javascripts/vendor/jquery.mapit.min.js new file mode 100644 index 0000000..e69de29 diff --git a/demo/stylesheets/github.css b/demo/stylesheets/github.css new file mode 100644 index 0000000..088f065 --- /dev/null +++ b/demo/stylesheets/github.css @@ -0,0 +1,88 @@ +/** + * GitHub theme + * + * @author Craig Campbell + * @version 1.0.4 + */ +pre { + border: 1px solid #ccc; + word-wrap: break-word; + padding: 6px 10px; + line-height: 19px; + margin-bottom: 20px; +} + +code { + border: 1px solid #eaeaea; + margin: 0px 2px; + padding: 0px 5px; + font-size: 12px; +} + +pre code { + border: 0px; + padding: 0px; + margin: 0px; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; +} + +pre, code { + font-family: Consolas, 'Liberation Mono', Courier, monospace; + color: #333; + background: #f8f8f8; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +pre, pre code { + font-size: 13px; +} + +pre .comment { + color: #998; +} + +pre .support { + color: #0086B3; +} + +pre .tag, pre .tag-name { + color: navy; +} + +pre .keyword, pre .css-property, pre .vendor-prefix, pre .sass, pre .class, pre .id, pre .css-value, pre .entity.function, pre .storage.function { + font-weight: bold; +} + +pre .css-property, pre .css-value, pre .vendor-prefix, pre .support.namespace { + color: #333; +} + +pre .constant.numeric, pre .keyword.unit, pre .hex-color { + font-weight: normal; + color: #099; +} + +pre .entity.class { + color: #458; +} + +pre .entity.id, pre .entity.function { + color: #900; +} + +pre .attribute, pre .variable { + color: teal; +} + +pre .string, pre .support.value { + font-weight: normal; + color: #d14; +} + +pre .regexp { + color: #009926; +} diff --git a/demo/stylesheets/reset.css b/demo/stylesheets/reset.css new file mode 100644 index 0000000..70e4084 --- /dev/null +++ b/demo/stylesheets/reset.css @@ -0,0 +1,135 @@ +/** + * BlankPlate | Yet another HTML5 Starter Kit + * + * BlankPlate Reset stylesheet + * + * Normally you don't have to make any changes in this file. + * Your changes should be placed in styles.css file. + * + * @copyright Copyright 2013, Dimitris Krestos + * @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php) + * @link http://vdw.staytuned.gr/html5-starter-kit-blankplate/ + * @package BlankPlate + * @version v1.3.2 + */ + +/** + * GLOBAL + * Reset margins and paadings for all + * ------------------------------------------------------------------------------------------------- + */ +* { + margin: 0; + outline: none; + padding: 0 +} + +/** + * COMMON + * Based on Eric Meyer's reset (http://meyerweb.com/eric/tools/css/reset/index.html) + * ------------------------------------------------------------------------------------------------- + */ +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, +acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, +sub, sup, tt, var,b, u, i, center,dl, dt, dd, ul, li, fieldset, form, label, legend, table, caption, +tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, +header, hgroup, menu, nav, output, ruby, section, summary,time, mark, audio, video { + background: transparent; + border: 0; + font-family: inherit; + font-size: 100%; + font-style: inherit; + font-weight: inherit; + line-height: 100%; + vertical-align: baseline +} + +/** + * HTML5 ELEMENTS + * Handle the following as blocks + * ------------------------------------------------------------------------------------------------- + */ +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { + display: block +} + +/** + * HEADINGS + * Reset headings weight + * ------------------------------------------------------------------------------------------------- + */ +h1, h2, h3, h4, h5, h6 { + font-weight: normal +} + +/** + * TABLES + * Reset table borders + * ------------------------------------------------------------------------------------------------- + */ +table { + border-collapse: collapse; + border-spacing: 0 +} + +/** + * LISTS + * Reset list styles + * ------------------------------------------------------------------------------------------------- + */ +ol, ul { + list-style: none outside none +} + +/** + * HYPHENS + * http://meyerweb.com/eric/thoughts/2012/12/17/where-to-avoid-css-hyphenation + * ------------------------------------------------------------------------------------------------- + */ +abbr, acronym, blockquote, code, dir, kbd, listing, plaintext, q, samp, tt, var, xmp { + -webkit-hyphens: none; /* Safari 5.1 thru 6, iOS 4.2 thru 6 */ + -moz-hyphens: none; /* Firefox 16 thru 20 */ + -ms-hyphens: none; /* IE10 */ + -o-hyphens: none; /* PRESTO */ + hyphens: none; /* W3C standard */ +} + +/** + * MORE RESET + * + * ------------------------------------------------------------------------------------------------- + */ +hr { + border: 0; + border-top: 1px solid #CCC; + display: block; + height: 1px; + margin: 1em 0 +} + +blockquote, q { + quotes: none +} + +/** + * FIXES + * + * ------------------------------------------------------------------------------------------------- + */ +a { + cursor: pointer +} + +iframe, img { + vertical-align: bottom +} + +button, input[type="button"], input[type="reset"], input[type="submit"] { + *overflow: visible; + -webkit-appearance: button; +} + +blockquote:before, blockquote:after, q:before, q:after { + content: ""; + content: none +} \ No newline at end of file diff --git a/demo/stylesheets/styles.css b/demo/stylesheets/styles.css new file mode 100644 index 0000000..a15751c --- /dev/null +++ b/demo/stylesheets/styles.css @@ -0,0 +1,93 @@ +/** + * BlankPlate | Yet another HTML5 Starter Kit + * + * BlankPlate Main stylesheet + * + * @copyright Copyright 2013, Dimitris Krestos + * @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php) + * @link http://vdw.staytuned.gr/html5-starter-kit-blankplate/ + * @package BlankPlate + * @version v1.3.2 + */ + +/** + * WORLD + * + * ------------------------------------------------------------------------------------------------- + */ +BODY { + font-size: 13px; /* Override typography */ +} + +#wrapper { + margin: 0 auto; + max-width: 960px; +} + +/** + * HEADER + * Your header rules + * ------------------------------------------------------------------------------------------------- + */ +HEADER {} + +/** + * NAVIGATION + * Your horizontal (global) navigation rules + * ------------------------------------------------------------------------------------------------- + */ +NAV {} + +NAV UL { /* Level 0 */ + float: left; +} + +/** + * ASIDE + * Your side bar rules + * ------------------------------------------------------------------------------------------------- + */ +ASIDE { + float: left +} + +/** + * BODY + * Your content rules + * ------------------------------------------------------------------------------------------------- + */ +SECTION#body { + float: left; + width: 100%; +} + +ARTICLE {} + +#map_canvas { + height: 450px; + width: 960px; +} + +/** + * CONTACT + * Your form rules + * ------------------------------------------------------------------------------------------------- + */ +.contact FORM {} + +.contact FORM INPUT[type="text"] { + padding: 0 10px; +} + +.contact FORM INPUT[type="submit"] { + margin: 0; +} + +/** + * FOOTER + * Your footer rules + * ------------------------------------------------------------------------------------------------- + */ +FOOTER { + padding: 1em 0 2em 0; +} \ No newline at end of file diff --git a/demo/stylesheets/typography.css b/demo/stylesheets/typography.css new file mode 100644 index 0000000..fd2b5ce --- /dev/null +++ b/demo/stylesheets/typography.css @@ -0,0 +1,288 @@ +/** + * BlankPlate | Yet another HTML5 Starter Kit + * + * BlankPlate Basic Typography stylesheet + * + * Normally you don't have to make any changes in this file. + * Your changes should be placed in styles.css file. + * + * @copyright Copyright 2013, Dimitris Krestos + * @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php) + * @link http://vdw.staytuned.gr/html5-starter-kit-blankplate/ + * @package BlankPlate + * @version v1.3.2 + */ + +/** + * FONTS + * A font face implementation + * ------------------------------------------------------------------------------------------------- + */ +/* +@font-face { + font-family: 'TheDummyFontID'; + src: url('fonts/dummyfont.eot'); /* IE6–8 */ + + /* FF3.6+, IE9, Chrome6+, Saf5.1+ */ + /* Saf3—5, Chrome4+, FF3.5, Opera 10+ */ +/* + src: url('fonts/dummyfont.eot?#iefix') format('embedded-opentype'), + url('fonts/dummyfont.woff') format('woff'), + url('fonts/dummyfont.ttf') format('truetype'), + url('fonts/dummyfont.svg#TheDummyFontID') format('svg'); + font-weight: normal; + font-style: normal; +} +*/ +/** + * DOCUMENT FONT + * A basic declaration of document font and some font stacks + * ------------------------------------------------------------------------------------------------- + */ +BODY { + color: #404040; + font-family: Georgia, Palatino, "Palatino Linotype", Times, "Times New Roman", serif; + + /* + Some basic font stacks from cssfontstack.com + + Sans Serif + font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; + font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif; + font-family: Helvetica, "Helvetica Neue", Arial, sans-serif; + font-family: Tahoma, Verdana, Segoe, sans-serif; + font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif; + font-family: Verdana, Geneva, sans-serif; + + Serif + font-family: Georgia, Palatino, "Palatino Linotype", Times, "Times New Roman", serif; + font-family: TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif; + + Monospaced + font-family: Consolas, monaco, monospace; + font-family: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace; + font-family: "Lucida Sans Typewriter", "Lucida Console", Monaco, "Bitstream Vera Sans Mono", monospace; + */ + + /* Ratio ~1.38 */ + font-size: 0.813em; /* ~13px */ + line-height: 1.385em; /* ~18px */ +} + +/** + * LINKS + * + * ------------------------------------------------------------------------------------------------- + */ +A { + color: black; + text-decoration: none +} + +A:hover { + text-decoration: underline +} + +/** + * HEADINGS + * + * ------------------------------------------------------------------------------------------------- + */ +H1 { + font-size: 2.308em; /* 30px */ + line-height: 1.500em; /* 44px */ +} + +H2 { + font-size: 1.846em; /* 24px */ + line-height: 1.500em; /* 36px */ +} + +H3 { + font-size: 1.538em; /* 20px */ + line-height: 1.500em; /* 27px */ +} + +H4 { + font-size: 1.385em; /* 18px */ + line-height: 1.500em; /* 24px */ +} + +H5, H6 { + font-size: 1.231em; /* 16px */ + line-height: 1.500em; /* 24px */ +} + +H1, H2, H3, H4, H5, H6 { + color: #333 +} + +H1 A, H2 A, H3 A, H4 A, H5 A, H6 A { + color: inherit; + font-weight: inherit +} + +/** + * RULERS AND PARAGRAPHS + * + * ------------------------------------------------------------------------------------------------- + */ +HR { + background: #CCC; + border-top-color: #CCC +} + +P { + line-height: 1.385em; + margin-bottom: 1.077em; /* ~ line-height * 0.75 */ +} + +P:empty { /* Hide empty paragraphs */ + display: none +} + +/** + * LISTS + * + * ------------------------------------------------------------------------------------------------- + */ +UL, OL { /* Horizontal & vertical lists */ + margin: 1.077em 0 1.077em 1.538em; /* 14px 0 14px 20px */ +} + +UL LI, OL LI { + line-height: 1.385em +} + +UL.vertical { /* Vertical lists */ + margin: 0 +} + +UL.horizontal { /* Horizontal lists */ + display: inline; + margin: 0 +} + +UL.horizontal > LI { + display: inline-block; + + /* IE */ + *margin: 1px; + zoom: 1; + *display: inline; +} + +/** + * BLOCKQUOTES AND CODE BOXES + * + * ------------------------------------------------------------------------------------------------- + */ +BLOCKQUOTE { + border-left: 0.308em solid #EEE; /* 4px */ + color: #666; + margin-bottom: 0.769em; /* 10px */ + margin-left: 1.538em; /* 20px */ + margin-top: 0.769em; /* 10px */ + padding-left: 0.769em; /* 10px */ +} + +PRE { + color: #333; + display: block; + font-family: Courier, 'Courier New', monospace; + margin: 0 0.154em; /* 0 2px */ + padding: 0.154em 0.308em; /* 2px 4px */ +} + +CODE { + background-color: #F8F8F8; + border: 1px solid #CCC; + border-radius: 0.231em; /* 3px */ + color: #333; + display: block; + font-family: Courier, 'Courier New', monospace; + margin: 0 0.154em; /* 0 2px */ + padding: 0.077em 0.308em; /* 2px 4px */ +} + +CODE.monokai { /* Based on Monokai scheme colors */ + background-color: #272822; + color: #FB4383 +} + + +/** + * ABBREVIATIONS + * + * ------------------------------------------------------------------------------------------------- + */ +ABBR { + border-bottom: 1px dotted black; +} + +ABBR[title]:hover { /* Change cursor to a question mark when it has a title */ + cursor: help; +} + +/** + * NESTING + * + * ------------------------------------------------------------------------------------------------- + */ +P > CODE { + display: inline-block +} + +P B, LI B, P STRONG, LI STRONG { + font-weight: bold +} + +P I, LI I, P EM, LI EM { + font-style: italic +} + +ARTICLE.capitalise H2 + P:first-letter { /* Capitalise first letter of the paragraph */ + font-size: 2.769em; /* 36px */ + float: left; + letter-spacing: 0.111em;/* 4px */ + margin-top: 0.167em; /* 6px */ +} + +ARTICLE UL { + list-style: disc outside none; + margin-left: 2.615em; /* 34px */ +} + +ARTICLE OL { + list-style: decimal outside none; + margin-left: 2.615em; /* 34px */ +} + +FORM .vertical { + list-style: none; +} + +LI > LABEL { + display: inline-block; + padding: 0; + vertical-align: middle; +} + +LI > INPUT[type="radio"], +LI > INPUT[type="checkbox"] { + margin: 0; + vertical-align: middle; +} + +/** + * PLACEHOLDERS + * + * ------------------------------------------------------------------------------------------------- + */ +input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { + color: #C0C0C0 +} + +input:-moz-placeholder, textarea:-moz-placeholder { + color: #C0C0C0 +} \ No newline at end of file diff --git a/jquery.mapit.js b/jquery.mapit.js new file mode 100644 index 0000000..19eb3b1 --- /dev/null +++ b/jquery.mapit.js @@ -0,0 +1,211 @@ +/** + * bQuery + * + * @copyright Copyright 2013, Dimitris Krestos + * @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php) + * @link http://vdw.staytuned.gr + * @version v0.1.0 + */ + + /* Sample html structure + +
+ + */ + +document.write(''); + +;(function($, window, undefined) { + "use strict"; + + $.fn.mapit = function(options) { + + var defaults = { + latitude: 37.9792, + longitude: 23.751344, + zoom: 14, + marker: { + latitude: 37.9792, + longitude: 23.751344, + icon: 'images/marker.png', + title: 'Marker title', + open: false + }, + address: '', + locations: [] + }; + + var options = $.extend(defaults, options); + + $(this).each(function() { + + var $this = $(this); + + var address = '

The Y Hotel

Μυκόνου 3, Κεφαλάρι - Κηφισιά
Αθήνα 145 62, Ελλάδα

Τηλ.: +30 210 801 8495
Fax: +30 210 801 5218

'; + + // Locations + var locations = [ + ['Metropolitan Expo','', 'CC', 37.955297, 23.956861, 4, 'yellow'], + ['MEC SA', 'Μεσογειακό Εκθεσιακό Κέντρο', 'CC', 37.975327, 23.853106, 5, 'yellow'], + ['E.Κ.Ε.Π', '', 'CC', 38.065798, 23.760481, 3, 'yellow'], + ['Εκθεσιακό Κέντρο Helexpo ', '', 'CC', 38.058905, 23.797531, 2, 'yellow'], + + ['Avenue Mall', '', 'MA', 38.034901, 23.796095, 1, 'pink'], + ['Εμπορικό Κέντρο Αίγλη', '', 'MA', 38.072935, 23.815096, 1, 'pink'], + ['Golden Hall', '', 'MA', 38.034048, 23.792868, 1, 'pink'], + ['Shopping Land', '', 'MA', 38.073214, 23.814098, 1, 'pink'], + ['The Mall Athens', '', 'MA', 38.046266, 23.790536, 1, 'pink'], + + ['Ολυμπιακό Κέντρο Αθηνών Σπύρος Λούης (ΟΑΚΑ)', '', 'SC', 38.044902, 23.78062, 1, 'blue'], + ['Politia Tennis Club', '', 'SC', 38.086735, 23.832412, 1, 'blue'], + ['Gipedakia.gr', '', 'SC', 38.083399, 23.791364, 1, 'blue'], + + ['ΙΑΣΩ', '', 'HO', 38.034318, 23.795741, 1, 'green'], + ['emBIO', '', 'HO', 38.013341, 23.785372, 1, 'green'], + ['KAT', '', 'HO', 38.066947, 23.809925, 1, 'green'], + ['Αthens Medical Centre', '', 'HO', 38.042996, 23.805365, 1, 'green'], + ['Διαγνωστικό Κέντρο Υγεία', '', 'HO', 38.027498, 23.789887, 1, 'green'], + ['Γενικό Ογκολογικό Νοσοκομείο Κηφισιάς', '', 'HO', 38.086042, 23.7891, 1, 'green'], + ['Γενικό Νοσοκομείο Παίδων Πεντέλης', '', 'HO', 38.050338, 23.871712, 1, 'green'], + ['1ο Νοσοκομείο ΙΚΑ Αθηνών', '', 'HO', 38.056075, 23.84268, 1, 'green'], + ['Μητέρα', '', 'HO', 38.030921, 23.789839, 1, 'green'], + + ['MIHALARIAS ART', '', 'CA', 38.034707, 23.794473, 1, 'orange'], + ['Μουσείο Γουλανδρή Φυσικής Ιστορίας', '', 'CA', 38.074852, 23.814877, 1, 'orange'], + ['Μουσείο Τηλεπικοινωνιών ΟΤΕ', '', 'CA', 38.089057, 23.809301, 1, 'orange'], + ['Μουσείο Δροσίνη', '', 'CA', 38.07087, 23.811819, 1, 'orange'] + ]; + + // Origins + var athens = ['37.983715', '23.72931']; + var piraeus = ['37.947091', '23.64261']; + var airport = ['37.943072', '23.950306']; + + // Init Map + var directionsDisplay = new google.maps.DirectionsRenderer(); + + var mapOptions = { + scaleControl: false, + center: new google.maps.LatLng(options.latitude, options.longitude), + zoom: options.zoom, + mapTypeId: google.maps.MapTypeId.ROADMAP + }; + var map = new google.maps.Map(document.getElementById($this.attr('id')), mapOptions); + directionsDisplay.setMap(map); + + // Home Marker + var home = new google.maps.Marker({ + map: map, + //position: map.getCenter() + position: new google.maps.LatLng(options.marker.latitude, options.marker.longitude), + icon: new google.maps.MarkerImage(options.marker.icon), + title: options.marker.title + }); + + // Add info on the home marker + var info = new google.maps.InfoWindow({ + content: address + }); + + // Open the info window immediately + if (options.marker.open) { + info.open(map, home); + } else { + google.maps.event.addListener(home, 'click', function() { + info.open(map, home); + }); + }; + + // Create Markers + var infowindow = new google.maps.InfoWindow(); + var marker, i; + var markers = []; + + for (i = 0; i < locations.length; i++) { + + // Add Markers + marker = new google.maps.Marker({ + position: new google.maps.LatLng(locations[i][3], locations[i][4]), + map: map, + icon: new google.maps.MarkerImage('/images/website/'+locations[i][6]+'_marker.png') + }); + + // Create an array of the markers + markers.push(marker); + + // Init info for each marker + google.maps.event.addListener(marker, 'click', (function(marker, i) { + return function() { + infowindow.setContent(locations[i][0]+"
"+locations[i][1]); + infowindow.open(map, marker); + } + })(marker, i)); + + } + + // Directions + var directionsService = new google.maps.DirectionsService(); + + function route(origins) { + var request = { + origin: new google.maps.LatLng(eval(origins)[0], eval(origins)[1]), + destination: new google.maps.LatLng(38.074185, 23.818928), + travelMode: google.maps.TravelMode.DRIVING + }; + directionsService.route(request, function(result, status) { + if (status == google.maps.DirectionsStatus.OK) { + directionsDisplay.setDirections(result); + } + }); + } + + // Hide Markers Once (helper) + function hide_all() { + for (var i=0; i=1.8.1" + } +} diff --git a/test/index.html b/test/index.html new file mode 100644 index 0000000..4500bca --- /dev/null +++ b/test/index.html @@ -0,0 +1,34 @@ + + + + + bQuery | A blank template for building jQuery plugins + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + diff --git a/test/jquery.mapit.test.js b/test/jquery.mapit.test.js new file mode 100644 index 0000000..36da1fe --- /dev/null +++ b/test/jquery.mapit.test.js @@ -0,0 +1,8 @@ +/** + * Draft Tests using QUnit + * + */ + +$(".selector").bquery(); + +test( "Initialization", function() {}); \ No newline at end of file