Skip to content

Commit

Permalink
Merge remote branch 'upstream/master'
Browse files Browse the repository at this point in the history
Conflicts:
	jquery.jmapping.js
  • Loading branch information
tra committed Feb 13, 2011
2 parents b1affe1 + 6e4593f commit d5cd2b4
Show file tree
Hide file tree
Showing 14 changed files with 8,155 additions and 5,003 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
== 2.1.0 / 2011-01-28
* Fixed `force_zoom_level` & `default_zoom_level`
* Add `always_show_markers` option (mokolabs)

== 2.0.0 / 2010-11-24
* Use version 3 of Google Maps API
* Add `default_point` setting. (gsterndale)
* Add `force_zoom_level` setting.
* Use StyledMarker instead of MapIconMaker as MapIconMaker is incompatible with v3 of the Google Maps API.

== 1.4.0 / 2010-07-11

* Uncache metadata on update.
* Allow creating many different types of markers based on categories.

== 1.3.0 / 2010-07-11

* Use data-jmapping attribute for metadata by default.
* add `default_zoom_level` option

== 1.2.1 / 2010-03-12

* Also call `map.checkResize()` when updating the map.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2009 Brian Landau of Viget Labs
Copyright (c) 2009-2010 Brian Landau of Viget Labs

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
55 changes: 33 additions & 22 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@ This way the HTML semantically reflects that all of those parts and information
Basic Usage
------------

[Start by getting a Google Maps API key](http://code.google.com/apis/maps/signup.html).
Download the necessary dependencies and jMapping.

Make sure you include the necessary scripts in your page:

<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=someapikey"></script>
<script type="text/javascript" src="mapiconmaker.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.3&amp;sensor=false"></script>
<script type="text/javascript" src="markermanager.js"></script>
<script type="text/javascript" src="StyledMarker.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery.metadata.js"></script>
<script type="text/javascript" src="jquery.jmapping.js"></script>

Make sure your HTML has a `div` element for the Google map, and there is a container element with some locations and their data. The data by default is expected to be on the "data" attribute of the location (this can be configured):
Make sure your HTML has a `div` element for the Google map, and there is a container element with some locations and their data. The data by default is expected to be on the "data-jmapping" attribute of the location (this can be configured):

<div id="map"></div>

<div id="map-side-bar">
<div class="map-location" data="{id: 5, point: {lat: 35.925, lng: -79.053}, category: 'Gas'}">
<div class="map-location" data-jmapping="{id: 5, point: {lat: 35.925, lng: -79.053}, category: 'Gas'}">
<a href="#" class="map-link">Some Place</a>
<div class="info-box">
<p>Some thing for the info box.</p>
</div>
</div>
<div class="map-location" data="{id: 8, point: {lat: 35.935, lng: -79.024}, category: 'Food'}">
<div class="map-location" data-jmapping="{id: 8, point: {lat: 35.935, lng: -79.024}, category: 'Food'}">
<a href="#" class="map-link">Another Place</a>
<div class="info-box">
<p>Example Text.</p>
Expand Down Expand Up @@ -101,6 +101,9 @@ These are options that can be passed to the `jMapping` function to change specif
* This selector defines where the content for the Google Maps info window for each location marker is.
This element will be searched for inside of the location elements specified in the `location_selector`.
If no element is found no Info Window will be attached to the marker.
* `default_point`:
* *Default*: `{lat: 0.0, lng: 0.0}`
* This point determines the Google Maps location if there are no location elements inside the specified `location_selector`.
* `metadata_options`:
* *Default*: `{type: "attr", name: "data"}`
* This is the set of options passed to the jQuery metadata function. It defines how the necessary
Expand All @@ -112,24 +115,32 @@ These are options that can be passed to the `jMapping` function to change specif
Otherwise it will expand to fit the width of the content.
* `map_config`:
* *Default*: *N/A*
* This can be set to a function that will accept the Google maps object as it's only parameter.
The function can be used to set the map type or add controls or perform any other functions you
want to do on the map object before the markers are placed on it.
If this option is not set the map type will be `G_NORMAL_MAP` and only the `GSmallMapControl`
control will be added.
* This can be set to a [MapOptions object](http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions). Which is just a normal object `{}` with specific properties that become the settings for the map.
* `category_icon_options`:
* *Default*: *N/A*
* By default the plugin will use the default Google Maps marker icon. But you can use this option
to specify what options to pass to the MapIconMaker based on category data associated with the location.
to specify what options to pass to the StyledMarker based on category data associated with the location.
It accepts 2 types of values: an object or a function.
If the setting is to an object it will take the category data on the location and look for a key on the object
that matches and return that value. If there is no value for the supplied category, it will return
the value specified in the "default" key.
If the setting is set to a function it will call the function and pass the value for the
category data to the function, returning the result. This can be used for more complicated logic and for
using something other then just string data in the category, such as an object with multiple data
attributes it's self. The function should return an object with attributes that are
[valid for a MarkerIconOptions object](http://gmaps-utility-library.googlecode.com/svn/trunk/mapiconmaker/1.1/docs/reference.html).
attributes it's self.
The object values for the associated category key or the function should return one of three data types:
1. A string, this will be used as the image source for the marker icon.
2. A [google.maps.MarkerImage](http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerImage), this will be used as the icon for the Marker object.
3. An object that has [valid options for a StyledIcon object](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/styledmarker/docs/reference.html#StyledIconOptions).
* `default_zoom_level`:
* *Default*: *N/A*
* Use this option to set the default zoom level for your map. Normally, zoom level is set dynamically based on the position of locations being mapped. But, in some cases, like viewing a single mapped location, you may wish to set a default zoom level. Zoom level values should be between 1 and 20. Neighborhood level is approximately 15.
* `force_zoom_level`:
* *Default*: *N/A*
* This will force the map to **always** be rendered at this zoom level.
* `always_show_markers`:
* *Default*: `false`
* Set this option to `true` if you wish to display markers on all zoom levels. (Normally, the markers may only be visible on certain zoom levels, depending on the normal bounds and zoom level of the marker data.)

Object API
-----------
Expand All @@ -145,20 +156,20 @@ For example:
The API of that object:

* `gmarkers`:
* The GMarker objects that have been placed on the map.
* The google.maps.Marker objects that have been placed on the map.
Stored in an object where the keys are the id's are those provided in the metadata
* `settings`:
* The settings for this jMapping instance.
* `mapped`:
* Did the plugin create the map and markers as expected or not.
* `map`:
* the GMap2 Google Map API object.
* the google.maps.Map Google Map API object.
* `markerManager`:
* The Google Maps MarkerManager object for manipulating groups of markers, has control over all markers on the map.
* `gmarkersArray`:
* Returns an array of all the markers currently on the map.
* `getBounds`:
* The Google Maps GLatLngBounds bounds object for all the markers on the map.
* The Google Maps google.maps.LatLngBounds bounds object for all the markers on the map.
* `getPlaces`:
* Returns the set of jQuery objects for the place DOM Elements.
* `getPlacesData`:
Expand Down Expand Up @@ -189,14 +200,14 @@ There a number of events that fire as jMapping is used.
Dependencies
-------------

* [jQuery 1.3.2](http://docs.jquery.com/Downloading_jQuery)
* [jQuery 1.4.4](http://docs.jquery.com/Downloading_jQuery)
* [jQuery Metadata plugin 2.1](http://plugins.jquery.com/project/metadata)
* [MarkerManager 1.1](http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/)
* [MapIconMaker 1.1](http://gmaps-utility-library.googlecode.com/svn/trunk/mapiconmaker/1.1/)
* [MarkerManager v3 1.0](http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/1.0)
* [StyledMarker 0.5](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/styledmarker)


License
--------

Copyright (c) 2009 Brian Landau (Viget Labs)
Copyright (c) 2009-2011 Brian Landau (Viget Labs)
MIT License: [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ task :minify => ['jquery.jmapping.min.js']
Rake::PackageTask.new("jquery.jmapping", (ENV['VERSION'] || :noversion)) do |p|
p.need_tar_gz = true
p.need_zip = true
p.package_files.add 'jquery.*.js', 'README.markdown', 'CHANGELOG'
p.package_files.add 'jquery.*.js', 'README.markdown', 'CHANGELOG', 'vendor/jquery.metadata.js',
'vendor/StyledMarker.js', 'vendor/markermanager.js'
end

if PLATFORM['darwin']
Expand Down
Loading

0 comments on commit d5cd2b4

Please sign in to comment.