Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker additions #311

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions source/mxn.(provider).core.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,24 @@ Marker: {

update: function() {
// TODO: Add provider code
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},

Polyline: {

fromProprietary: function(propPolyline) {
// TODO: Add provider code
},

toProprietary: function() {
// TODO: Add provider code
},
Expand All @@ -276,8 +288,7 @@ Polyline: {

hide: function() {
// TODO: Add provider code
}

}
}

});
10 changes: 9 additions & 1 deletion source/mxn.cloudmade.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,16 @@ mxn.register('cloudmade', {

update: function() {
// TODO: Add provider code
}
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},

Polyline: {
Expand Down
24 changes: 22 additions & 2 deletions source/mxn.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,9 @@ var Marker = mxn.Marker = function(point) {
mxn.addEvents(this, [
'openInfoBubble', // Info bubble opened
'closeInfoBubble', // Info bubble closed
'click' // Marker clicked
'click', // Marker clicked
'dragstart', // Marker drag begin
'dragend' // Marker drag end
]);
};

Expand Down Expand Up @@ -1449,7 +1451,25 @@ mxn.addProxyMethods(Marker, [
* @name mxn.Marker#update
* @function
*/
'update'
'update',

/**
* Updates the current Marker to use a different image.
* @name mxn.Marker#updateIcon
* @function
* @param {String} iconUrl The URL of the image you want to be the icon
* @param {String} iconSize The size of the icon image
*/
'updateIcon',

/**
* Updates the current Marker to use a different location point.
* @name mxn.Marker#updateLocation
* @function
* @param {LatLonPoint} point The new location
*/
'updateLocation'

]);

Marker.prototype.setChild = function(some_proprietary_marker) {
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.geocommons.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ mxn.register('geocommons', {

update: function() {
// TODO: Add provider code
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},
Expand Down
18 changes: 18 additions & 0 deletions source/mxn.google.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ Mapstraction: {
GEvent.addListener(gpin, 'infowindowclose', function() {
marker.closeInfoBubble.fire();
});
GEvent.addListener(gpin, 'dragstart', function() {
marker.dragstart.fire();
});
GEvent.addListener(gpin, 'dragend', function() {
marker.dragend.fire();
});

return gpin;
},

Expand Down Expand Up @@ -492,6 +499,17 @@ Marker: {
point = new mxn.LatLonPoint();
point.fromProprietary('google', this.proprietary_marker.getPoint());
this.location = point;
},

updateIcon: function(iconUrl, iconSize) {
if (iconUrl) {
this.proprietary_marker.setImage(iconUrl);
}
},

updateLocation: function(point) {
this.location = point;
this.proprietary_marker.setPoint(point.toProprietary('google'));
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.googleearth.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ Marker: {

update: function() {
// TODO: Add provider code
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},
Expand Down
29 changes: 28 additions & 1 deletion source/mxn.googlev3.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,16 @@ Mapstraction: {
},

addMarker: function(marker, old) {
return marker.toProprietary(this.api);
var gpin = marker.toProprietary(this.api);

google.maps.event.addListener(gpin, 'dragstart', function() {
marker.dragstart.fire();
});
google.maps.event.addListener(gpin, 'dragend', function() {
marker.dragend.fire();
});

return gpin;
},

removeMarker: function(marker) {
Expand Down Expand Up @@ -586,6 +595,24 @@ Marker: {
var point = new mxn.LatLonPoint();
point.fromProprietary('googlev3', this.proprietary_marker.getPosition());
this.location = point;
},

updateIcon: function(iconUrl, iconSize) {
var icon = this.proprietary_marker.getIcon();

if (iconUrl) {
icon.url = iconUrl;
}
if (iconSize) {
icon.size = new google.maps.Size(iconSize[0], iconSize[1]);
}

this.proprietary_marker.setIcon(icon);
},

updateLocation: function(point) {
this.location = point;
this.proprietary_marker.setPosition(point.toProprietary('googlev3'));
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.leaflet.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ Marker: {

update: function() {
throw 'Not implemented';
},

updateIcon: function(iconUrl, iconSize) {
throw 'Not implemented';
},

updateLocation: function(point) {
throw 'Not implemented';
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.microsoft.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,14 @@ Marker: {
var point = new mxn.LatLonPoint(this.proprietary_marker.Latitude,this.proprietary_marker.Longitude);

this.location = point;
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.microsoft7.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,14 @@ Marker: {
var loc = this.proprietary_marker.getLocation();
var point = new mxn.LatLonPoint(loc.latitude, loc.longitude);
this.location = point;
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.openlayers.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,14 @@ mxn.register('openlayers', {

update: function() {
// TODO: Add provider code
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.openmq.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,14 @@ Marker: {

update: function() {
// TODO: Add provider code
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.openspace.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ Marker: {

update: function() {
// TODO: Add provider code
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}
},

Expand Down
8 changes: 8 additions & 0 deletions source/mxn.ovi.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,14 @@ Marker: {

update: function() {
throw 'Not implemented';
},

updateIcon: function(iconUrl, iconSize) {
throw 'Not implemented';
},

updateLocation: function(point) {
throw 'Not implemented';
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.yahoo.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,14 @@ Marker: {

update: function() {
throw 'Not implemented';
},

updateIcon: function(iconUrl, iconSize) {
throw 'Not implemented';
},

updateLocation: function(point) {
throw 'Not implemented';
}

},
Expand Down
8 changes: 8 additions & 0 deletions source/mxn.yandex.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,14 @@ Marker: {
point = new mxn.LatLonPoint();
point.fromProprietary('yandex', this.proprietary_marker.getGeoPoint());
this.location = point;
},

updateIcon: function(iconUrl, iconSize) {
// TODO: Add provider code
},

updateLocation: function(point) {
// TODO: Add provider code
}
},

Expand Down