Skip to content

Commit

Permalink
Merge pull request #104 from SemanticMediaWiki/ajax-icon1
Browse files Browse the repository at this point in the history
ajax set icon #92
  • Loading branch information
JeroenDeDauw authored Aug 25, 2016
2 parents 74accb4 + a0e44e3 commit fac4b2b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/ext.sm.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ window.sm = new ( function( $, mw ) {
} );
};

this.ajaxUpdateMarker = function( map, query ) {
this.ajaxUpdateMarker = function( map, query, icon ) {
return this.sendQuery(query).done( function( data ) {
if ( !data.hasOwnProperty( 'query' ) ||
!data.query.hasOwnProperty( 'results' )) {
Expand All @@ -45,7 +45,8 @@ window.sm = new ( function( $, mw ) {
lat: coordinates.lat,
lon: coordinates.lon,
title: location.fulltext,
text: '<b><a href="' + location.fullurl + '">' + location.fulltext + '</a></b>'
text: '<b><a href="' + location.fullurl + '">' + location.fulltext + '</a></b>',
icon: icon
};
map.addMarker( markerOptions );
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/GoogleMaps3/ext.sm.googlemaps3ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if ( ajaxRequest !== null ) {
ajaxRequest.abort();
}
ajaxRequest = sm.ajaxUpdateMarker( map, query ).done( function () {
ajaxRequest = sm.ajaxUpdateMarker( map, query, map.options.icon ).done( function () {
map.createMarkerCluster();
ajaxRequest = null;
} );
Expand Down
2 changes: 1 addition & 1 deletion src/services/Leaflet/ext.sm.leafletajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
if ( ajaxRequest !== null ) {
ajaxRequest.abort();
}
ajaxRequest = sm.ajaxUpdateMarker( map, query ).done( function () {
ajaxRequest = sm.ajaxUpdateMarker( map, query, map.options.icon ).done( function () {
map.createMarkerCluster();
ajaxRequest = null;
} );
Expand Down
2 changes: 1 addition & 1 deletion src/services/OpenLayers/ext.sm.openlayersajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
if ( ajaxRequest !== null ) {
ajaxRequest.abort();
}
ajaxRequest = sm.ajaxUpdateMarker( map, query ).done( function () {
ajaxRequest = sm.ajaxUpdateMarker( map, query, map.options.icon ).done( function () {
ajaxRequest = null;
} );
} );
Expand Down

0 comments on commit fac4b2b

Please sign in to comment.