Skip to content

Commit

Permalink
jQueryGeo#173 - don't refresh all shape services
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanttb committed Apr 8, 2015
1 parent 64f24d7 commit b586078
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions js/jquery.geo.geomap.js
Expand Up @@ -600,7 +600,7 @@
this._$elem.closest( ".geo-map" ).geomap( "refresh", force, this._$elem );
} else {
this._refresh( force, _serviceContainer );
this._refreshAllShapes( );
this._refreshAllShapes( _serviceContainer );
}
},

Expand Down Expand Up @@ -1073,7 +1073,7 @@
this._$measureLabel.hide();
},

_refreshAllShapes: function ( ) {
_refreshAllShapes: function ( _serviceContainer ) {
this._timeoutRefreshShapes = null;

var service,
Expand All @@ -1082,17 +1082,20 @@

for ( ; i < this._currentServices.length; i++ ) {
service = this._currentServices[ i ];
geoService = service.serviceContainer.data( "geoService" );

if ( geoService._createdGraphics ) {
geoService._$shapesContainer.geographics( "clear" );
if ( geoService._graphicShapes.length > 0 ) {
geoService._refreshShapes( geoService._$shapesContainer, geoService._graphicShapes, geoService._graphicShapes, geoService._graphicShapes );
if ( !_serviceContainer || service.serviceContainer[ 0 ] === _serviceContainer[ 0 ] ) {
geoService = service.serviceContainer.data( "geoService" );

if ( geoService._createdGraphics ) {
geoService._$shapesContainer.geographics( "clear" );
if ( geoService._graphicShapes.length > 0 ) {
geoService._refreshShapes( geoService._$shapesContainer, geoService._graphicShapes, geoService._graphicShapes, geoService._graphicShapes );
}
}
}
}

if ( this._createdGraphics ) {
if ( this._createdGraphics && !_serviceContainer ) {
this._$shapesContainer.geographics( "clear" );
if ( this._graphicShapes.length > 0 ) {
this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
Expand Down

0 comments on commit b586078

Please sign in to comment.