Fix: JsLint Error
MODIFY
www/Map.js
www/Map.js
@@ -1335,20 +1335,21 @@ Map.prototype.addMarker = function(markerOptions, callback) {
// Generate a makrer instance at once.
//------------------------------------
markerOptions.icon = markerOptions.icon || {};
+ var link;
if (typeof markerOptions.icon === 'string') {
- if (markerOptions.icon.indexOf("://") === -1 &&
- markerOptions.icon.indexOf(".") === 0) {
+ if (markerOptions.icon.indexOf('://') === -1 &&
+ markerOptions.icon.indexOf('.') === 0) {
- var link = document.createElement('a');
+ link = document.createElement('a');
link.href = markerOptions.icon;
markerOptions.icon = link.protocol+'//'+link.host+link.pathname + link.search;
link = undefined;
}
} else if (typeof markerOptions.icon === 'object' && typeof markerOptions.icon.url === 'string') {
- if (markerOptions.icon.url.indexOf("://") === -1 &&
- markerOptions.icon.url.indexOf(".") === 0) {
+ if (markerOptions.icon.url.indexOf('://') === -1 &&
+ markerOptions.icon.url.indexOf('.') === 0) {
- var link = document.createElement('a');
+ link = document.createElement('a');
link.href = markerOptions.icon.url;
markerOptions.icon.url = link.protocol+'//'+link.host+link.pathname + link.search;
link = undefined;

MODIFY
www/Marker.js
www/Marker.js
@@ -57,20 +57,21 @@ var Marker = function(map, markerOptions, _exec, extras) {
self.on('icon_changed', function() {
var icon = self.get('icon');
+ var link;
if (typeof icon === 'string') {
- if (icon.indexOf("://") === -1 &&
- icon.indexOf(".") === 0) {
+ if (icon.indexOf('://') === -1 &&
+ icon.indexOf('.') === 0) {
- var link = document.createElement('a');
+ link = document.createElement('a');
link.href = icon;
icon = link.protocol+'//'+link.host+link.pathname + link.search;
link = undefined;
}
} else if (typeof icon === 'object' && typeof icon.url === 'string') {
- if (icon.url.indexOf("://") === -1 &&
- icon.url.indexOf(".") === 0) {
+ if (icon.url.indexOf('://') === -1 &&
+ icon.url.indexOf('.') === 0) {
- var link = document.createElement('a');
+ link = document.createElement('a');
link.href = icon.url;
icon.url = link.protocol+'//'+link.host+link.pathname + link.search;
link = undefined;

Fix: JsLint Error