Commit be76229f authored by Deployer's avatar Deployer

Fixed static map marker bug

parent fdbee134
...@@ -20,8 +20,8 @@ This is CedarMaps Javascript API. It's simply a wrapper for [Mapbox Javascript A ...@@ -20,8 +20,8 @@ This is CedarMaps Javascript API. It's simply a wrapper for [Mapbox Javascript A
Recommended usage is via the CedarMaps CDN: Recommended usage is via the CedarMaps CDN:
```html ```html
<script src='http://api.cedarmaps.com/cedarmaps.js/v1.4.0/cedarmaps.js'></script> <script src='http://api.cedarmaps.com/cedarmaps.js/v1.4.1/cedarmaps.js'></script>
<link href='http://api.cedarmaps.com/cedarmaps.js/v1.4.0/cedarmaps.css' rel='stylesheet' /> <link href='http://api.cedarmaps.com/cedarmaps.js/v1.4.1/cedarmaps.css' rel='stylesheet' />
``` ```
The `cedarmaps.js` file includes the Leaflet library. Alternatively, you can use `cedarmaps.standalone.js`, which does not include Leaflet (you will have to provide it yourself). The `cedarmaps.js` file includes the Leaflet library. Alternatively, you can use `cedarmaps.standalone.js`, which does not include Leaflet (you will have to provide it yourself).
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"author": "CedarStudios", "author": "CedarStudios",
"name": "cedarmaps.js", "name": "cedarmaps.js",
"description": "CedarMaps javascript API built on top of mapbox.js", "description": "CedarMaps javascript API built on top of mapbox.js",
"version": "1.4.0", "version": "1.4.1",
"homepage": "http://www.cedarmaps.com/", "homepage": "http://www.cedarmaps.com/",
"repository": { "repository": {
"type": "git", "type": "git",
......
...@@ -32,9 +32,17 @@ module.exports = function (container, options) { ...@@ -32,9 +32,17 @@ module.exports = function (container, options) {
} }
if (!options.position) { if (!options.position) {
options.position = 'auto'; options.position = 'auto';
} else {
if(typeof options.position !== 'object') {
throw 'Unknown value for position.'
}
} }
if (!options.dimensions) { if (!options.dimensions) {
throw 'Cedarmaps: No dimensions specified.'; throw 'Cedarmaps: No dimensions specified.';
} else {
if(typeof options.dimensions !== 'object') {
throw 'Unknown value for position.'
}
} }
if (!container) { if (!container) {
throw 'Cedarmaps: No container selector specified.'; throw 'Cedarmaps: No container selector specified.';
...@@ -49,7 +57,7 @@ module.exports = function (container, options) { ...@@ -49,7 +57,7 @@ module.exports = function (container, options) {
if (options.qs && options.qs.length > 0) { if (options.qs && options.qs.length > 0) {
var qs = 'markers='; var qs = 'markers=';
for (var i = 0, l = options.qs.length; i < l; i++) { for (var i = 0, l = options.qs.length; i < l; i++) {
if (options.qs[i].marker_url) { if (!options.qs[i].marker_url) {
options.qs[i].marker_url = 'marker-default'; options.qs[i].marker_url = 'marker-default';
} }
qs += options.qs[i].marker_url + '|' + options.qs[i].lat + ',' + options.qs[i].lng; qs += options.qs[i].marker_url + '|' + options.qs[i].lat + ',' + options.qs[i].lng;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment