
anthill-maps
Anthill Maps
Maps made easy using jQuery, and by adding default behaviour to nested google maps (or extended) elements.
We are just starting, please be patient.. we are working on docs and examples.
If you want to contribute, you are more than wellcome.
Enjoy.
Intro
Suppose you have the following HTML code on your body:
```html
Unknown end tag for </div>
```
Suppose you want to make a map, that contains a marker and when you click on the marker you want a "Hello World!" to appear on an info window..
Now suppose you could do it just like this:
```javascript
$('.map').maps({ class: 'Map', params: { zoom: 12, center: new google.maps.!LatLng(-31.4086, -64.19169), mapTypeId: google.maps.!MapTypeId.ROADMAP }, marker: { class: 'Marker', params: {position: new google.maps.!LatLng(-31.4086, -64.19169)}, iw: { class: '!InfoWindow', params: {content: 'Hello World!'} } } }); ```
Well.. stop supposing. Now it's possible!
The main idea behind all this, is to add default behaviour to map elements depending on who's the parent object. Hierarchy is provided by the wrapper object.
That is.. if you have a 'Marker' that is inside a 'Map', in most cases you'll want that marker to appear on the map.
And if you have an 'InfoWindow', that is inside a 'Marker', that is inside a 'Map'.. of course you'll want that info window to appear when you click on the marker.
Please, visit the API Index for more information.
Features
- Easy to mold, just add new entries, or modify behaviour in
methods
object inside js files or make your own extension. - ~~Extended google.maps.Polygon object, with edit(boolean) and contains(google.maps.LatLng) functions.~~ Now google.maps.Polygon provides setEditable method, so there is no need to create an other class. We'll leave the contains(google.maps.LatLng) method, and add it to google.maps.Polygon.prototype in anthill-polygon.js file.
- Extended google.maps.Geocode object to support many geocode requests.
- Objects with default behaviour (at the moment):
- Map
- Marker
- InfoWindow
- Polygon
- Polyline
- Geocoder
- DirectionService
What's next
- MarkerImage default behaviour
- ~~Capability to add behaviour beyond maps~~ There is now an easy way to extend any kind of functionality.
Project Information
The project was created on Nov 4, 2011.
- License: GNU GPL v3
- 1 stars
- svn-based source control
Labels:
jQuery
Mapping
Extension
JavaScript
node.js
websockets