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

View only recompiles on map pan/zoom #1168

Open
that1guy opened this issue Feb 15, 2017 · 0 comments
Open

View only recompiles on map pan/zoom #1168

that1guy opened this issue Feb 15, 2017 · 0 comments

Comments

@that1guy
Copy link

that1guy commented Feb 15, 2017

Note: This only happens on Safari Mobile! Not on desktop.

Watch this screencast to observe the issue:
https://screencast.com/t/ElXYloDCyt

Notice the banner at the top of the screen does not update unless I pan or zoom the map.

Here is what is in the view:

<div class="select-areas-header" ng-show="searchOptions.selectAreas || savedSearch.forceAreaSelection">
	<span id="exit-select-areas">
          <b>Select Areas Mode {{map.selectedAreas}}</b><span>{{!map.selectedAreas.length ? ' | Cancel' : ' | Done Selecting'}}</span>
        </span>
</div>

Here is what is in my controller:

//Keep map in sync with propertyFactory and mapFactory
  $scope.map = propertyFactory.map = mapFactory.map;

And here is the function that runs in my mapFactory when the user clicks an area on the map

function appendToSelectedAreas(layer) {
    layer.setStyle({
      fillColor: 'grey'
    });
    layer.bringToFront();

    factory.map.selectedAreas.push({
      _id: layer.feature._id,
      layer: layer,
      title: layer.feature.properties.boundary.name,
      coordinates: layer.feature.geometry.coordinates
    });
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant