question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

addTileOverlay getTile function not always working as expected.

See original GitHub issue

I’m submitting a … (check one with “x”) [ ] question [x] any problem or bug report [ ] feature request

The plugin version: (check one with “x”) [x] 2.0-beta3 (github) [ ] 2.0 (npm)

If you choose ‘problem or bug report’, please select OS: (check one with “x”) [x] Android [ ] iOS

cordova information: (run $> cordova plugin list)

com.googlemaps.ios 2.4.0 "Google Maps SDK for iOS"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googlemaps 2.0.9-beta-20170914-1830 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"

If you use @ionic-native/google-maps, please show me the package.json

Current behavior:

I try overlay a whole bunch of tiles which are on s3 using the addTileOverlay and getTile function. I have multiple polygons which I change between and zoom in and out different levels and pan around the map etc.

I store the tile overlay object and then whenever I change to a new polygon I remove the previous tile overlay object and add the new one.

Expected behavior:

Generally with the first polygon I select, the tiles overlay correctly and I can zoom in and out and they adjust correctly. However when I change back and forth between polygons (removing the tileOverlays each time), when I log to the console the x,y and zoom parameters they jump around between the different zoom levels. Then it keeps logging to the console multiple times even though I am not moving around the map at all.

Here is an image of the console log of the x,y,zoom when the map is dead still. image

If I keep the map still for long enough (possibly 2/3 minutes) it eventually starts getting the correct x,y and zoom and then the tiles overlay.

Is this a known issue / work around available?

Or is it possibly due to the fact that I am zooming in too quickly and for some reason the getTile function can’t handle it?

I have attached a function “overlayNewTiles()” and if I say keep running that function and refreshing the tiles it seems to keep going back to a lower zoom level instead of starting immediately at the current zoom level of the map.

Steps to reproduce:

Screen capture or video record:

Related code, data or error log (please format your code or data):

overlayNewTiles() { 
  this.currentTileOverlay.remove();
  this.map.addTileOverlay({
    tileSize: 256,
    getTile: function(x, y, zoom) {
     console.log(x,y,zoom);
    }).then(tileOverlay => {
      // Keep track of the tile overlay
     this.currentTileOverlay = tileOverlay;
    })
 }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:52 (32 by maintainers)

github_iconTop GitHub Comments

2reactions
wf9a5m75commented, Sep 26, 2017

It seems you steal Satellite images from Google Maps. https://s3.amazonaws.com/aero-test-data/2/visible/19/307263/223849.png 223849

This is really prohibited by the Google Maps API Terms of Usage

- 10.5 Intellectual Property Restrictions.

b. No derivative works. You will not modify or create a derivative work based on any Content unless expressly permitted to do so under these Terms.

Capturing the satellite images, modify them, and storing and providing as your app contents is agains this rule.

I don’t help you anymore.

1reaction
nicholasgcolescommented, Sep 26, 2017

For that specific boundary, I have 3 different layers (as the drone flew with both multispectral and visual camera).

See visual below: visible

See plant health (red and green) below: ndvi

See contours layer below (height information from the stitching the raw data together) contours

Google maps does not provide all these additional layers. I just did not include them with my project because for the purpose of the demo I thought it was easiest just to include the visual layer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

addTileOverlay getTile function not always working as expected.
Current behavior: I try overlay a whole bunch of tiles which are on s3 using the addTileOverlay and getTile function. I have multiple...
Read more >
TileOverlay: getTile() breakpoint never hit - Stack Overflow
I've put a breakpoint in the method getTile() at the line return null , but it's never hit. I expected that as the...
Read more >
Bug: TileOverlay.clearTileCache() does not work after ...
Hi, It seems like TileOverlay.clearTileCache() has no effect if TIleProvider.getTile() has returned previously NO_TILE for a particular tile.
Read more >
cordova-plugin-googlemaps/README.md - UNPKG
1, # Cordova GoogleMaps plugin for Android, iOS and Browser (version 2.4.5). 2. 3, This plugin displays Google Maps in your application.
Read more >
mil.nga.geopackage.GeoPackage#getTileDao - ProgramCreek.com
returns ALL available raster tile sources for all "imported" geopackage databases * * @return */ public List<GeopackageRasterTileSource> getTileSources() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found