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

map not fit perfect screen on ios #125

Closed
gimox opened this issue Oct 2, 2018 · 11 comments · Fixed by #572
Closed

map not fit perfect screen on ios #125

gimox opened this issue Oct 2, 2018 · 11 comments · Fixed by #572

Comments

@gimox
Copy link
Contributor

gimox commented Oct 2, 2018

Map view not fit flexible tag on ios device < X.

look at grey border.
It work on iphone X.

error

return new Padding(
      padding: new EdgeInsets.all(0.0),
      child: new Column(
        children: [
          new Flexible(
            child: new FlutterMap(
              options: new MapOptions(
                  center: new LatLng(39.213695, 9.121050),
                  interactive: false,
                  minZoom: 12.0,
                  maxZoom: 19.0,
                  zoom: 16.5,
                  onTap: (latLng) {
                    print('tap callback  $latLng');
                  },
                  onPositionChanged: (MapPosition mapPos) {
                    print("pos changed $mapPos");
                  }),
              layers: [
                new TileLayerOptions(
                    offlineMode: false,
                    urlTemplate:
                        "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
                    //  urlTemplate: "assets/offlinemaps/cagliari/{z}/{x}/{y}.png"),
                    subdomains: ['a', 'b', 'c']),
                new MarkerLayerOptions(markers: markers)
              ],
            ),
          ),
        ],
      ),
    );
@johnpryan
Copy link
Collaborator

Can you double check that you are using the latest version? (0.1.4)

@gimox
Copy link
Contributor Author

gimox commented Oct 2, 2018

I m using 0.1.4

@gimox gimox closed this as completed Oct 2, 2018
@johnpryan
Copy link
Collaborator

Were you able to figure out what was causing this?

@gimox
Copy link
Contributor Author

gimox commented Oct 2, 2018

I m investigating,no results for now. Flexible container fit correct all the space (as you see in the pick has gray background). Maps appear to be not in the center.

@gimox
Copy link
Contributor Author

gimox commented Oct 3, 2018

ok some news... this is related to option.zoom.

this code is working

 options: new MapOptions(
                 ...
                  maxZoom: 17.0,
                  zoom: 14.0,
                  ....
                 maxZoom: 18.0,
                  zoom: 17.0,

this code generate the problem

...
 maxZoom: 17.0,
 zoom: 16.5,
...
maxZoom: 17.0,
zoom: 15.5,
...
maxZoom: 17.0,
zoom: 14.5,

it seems that the problem appear when zoom is not int!!!

@johnpryan
Copy link
Collaborator

gotcha. I would vote to re-open this now that this is a reproducible bug

@jovanovski
Copy link

@gimox Thanks, saved me! zoom and maxZoom must be rounded doubles, with no decimal points.

@benoitskipr
Copy link

gotcha. I would vote to re-open this now that this is a reproducible bug

@johnpryan yes, it should be reopened, it still happens as of today, and the zoom property still is a double, and should definitely be a int

@benoitskipr
Copy link

mmmh, the gray bars also happen when using fitBounds() probably because it does not round the calculated zoom

@benoitskipr
Copy link

@johnpryan this ticket should be reopened, it happens all the time with fitbounds

@johnpryan johnpryan reopened this Oct 29, 2019
@pakutoma
Copy link

I have the same issue in Android, and I solved by:
src/layer/tile_layer.dart, Line 194

var tileZoom = _clampZoom(zoom.round().toDouble());

to

var tileZoom = _clampZoom(zoom.floorToDouble());

I want to send PR, but I can't know that this solution works perfectly or not.

Thanks.

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

Successfully merging a pull request may close this issue.

5 participants