TBC Macros and Extensions

 View Only
Expand all | Collapse all

questions regarding OverlayBag for showing WMTS tiles

  • 1.  questions regarding OverlayBag for showing WMTS tiles

    Posted 01-08-2026 16:28
    Edited by Ronny Schneider 01-10-2026 21:20

    Since the TBC crew is unwilling to look into this since literally years, Access is meanwhile able to do it, I'm tinkering on a macro that loads tiles from a WMTS source. 

    The TrimbleMaps background seems to be tied directly to HoopsViewCache, sorting everything out automatically. Hence it would just be a matter of Services.TrimbleMaps having the option to set different tile tokens for the URL. Instead of 0,1,2 it'd need to change TileCol, TileRow, TileMatrix. That's so simple that it is unbelievable it isn't possible after so many years.

    Currently, there doesn't seem to be a way to tweak Services.TrimbleMaps to download Tiles from anything different than TrimbleMaps, I'm running into errors/dead ends.

    I can get me the projects map services with

    tms = TrimbleMapsService(self.currentProject, 23) # don't know why it insists on a zoom level
    als = tms.AvailableServices
    

    But the changes I make to this public list, either by adding a new entry or just changing one of the URL's, won't persist. It is reset the next time I run the macro.

    Since the activeForm.View.ViewCache.TrimbleMapType is just pointing to a GUID from the above AvailableServices list it should just be a matter of making my changes there persistent. Just don't know how.

    It does have some helpers for computing the tile numbers.

    My own code for retrieving the tiles still needs some tuning but works. And I can add them as OverlayGeoImage.

    But the imagery is shown on top of everything else, covering it.

    Is there a way to show OverlayGeoImage tiles in the background, behind all drawing entities? Kind of an UnderlayBag.

    Is it somehow possible to remove entities from an OverlayBag without resetting/rebuilding it? I can avoid adding tiles that exist already, but I also want to remove tiles that are outside the current view, without erasing and rebuilding and reloading all tiles, while optimizing the bags amount of content.

    Or is there another way to add background imagery? I found something like ImageTileNetwork or HoopsCacheView.



    ------------------------------
    Ronny Schneider
    ------------------------------



  • 2.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 29 days ago

    🤔



    ------------------------------
    Nelson Hays
    ------------------------------



  • 3.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 29 days ago

    This is not WMTS as i.e. provided by Propeller, Google Maps, or other GIS and imagery sources.

    TBC still only supports WMS. Is something different.

    Google "difference wms wfs wmts"



    ------------------------------
    Ronny Schneider
    ------------------------------



  • 4.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 29 days ago

    I'm ignorant about the nuts and bolts behind this.

    When TBC launched the WMS support I was excited to search for compatible background map options for things like property owner maps, state highway milepost maps, etc, but never got anything to work... not sure who that functionality was intended for.



    ------------------------------
    Nelson Hays
    ------------------------------



  • 5.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 29 days ago

    Me neither, but I do know that Propeller only supports WMTS. Don't know since when exactly. Like the TBC crew, they don't compile decent release notes either. (I know there are TBC release notes, but usually a lot of things are not mentioned in them, hence rather worthless)

    Must be available since at least early/mid 2023 in Propeller.

    Trimble Access was reasonably quick I believe and supports it since 2023.10 which came out in October 2023 (https://help.fieldsystems.trimble.com/trimble-access-release-notes/en/2023.10.htm)

    Nearly 3 years later and TBC still doesn't support an inhouse platform.



    ------------------------------
    Ronny Schneider
    ------------------------------



  • 6.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 25 days ago

    Hi Ronny,

    There's several ways to control the visual depth of images and see the result you want. However, the OverlayBag (the Hoops one, specifically) does not support this capability - it was explicitly designed to draw on top of all other visuals and to not try and figure out which parts of the overlay are supposed to be in front of which other parts of that same overlay.

    Are you able to access and utilize all of the publicly available classes/methods in the code base? Maybe I can try to share a way to achieve the desired visual effect in another way, without using the Overlay. 

    Also - are you able to share the part of your code which inserts the images into the view? We could try and see if there's a convenient way to wire the depth control capability into the overlay.



    ------------------------------
    Arturas Grigorjevas
    ------------------------------



  • 7.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 23 days ago

    Hello Arturas,

    it's been a few weeks now that I last looked into this. Will try to piece together what I tried back then.

    Preferably I don't want to use the Overlaybag. I suspected as much, that it's meant to always draw on top of things. It was just a work around to somehow draw the tiles on the screen.

    They don't line up particularly well anyway, even though I compute bottom right and top left grid coordinates from the tile numbers. Horizontal gap and vertical overlap.

    Preferably I'd want to add a custom map to the project background maps.

    I'm able to add my URL to the list of Trimble Maps Tilesets and set it as active, but it isn't used.

    Even tricking it by overwriting one of the existing URLs doesn't work. They are not being used and somehow overwritten immediately.

    I just don't have more time currently to look into this.

    We shouldn't have to in the first place.

    You guys need to get a grip on fixing bugs and implement user requests. I've got a list of approximately 40 unactioned items.

    I shouldn't have to write dozens of macros myself and ANZToolbox and Rockpile shouldn't have a business model. At least not when it comes to absolute basics. Country specific tools, ok. But not things like explode linestring, a decent plan view rotate, slope/slope intersect, find and replace ......, creating even the simplest IFC objects. Where are our maintenance fees disappearing to?



    ------------------------------
    Ronny Schneider
    ------------------------------



  • 8.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 18 days ago

    Hi Ronny,

    Here's a very quick way to add images onto the screen:

    image

    Images which are drawn this way will be rendered behind every other object in the Plan View:

    image

    This does create real entities within the project, so you'd need to keep track of these images (or their serial numbers) and remove them from the project once they are no longer needed. Also, images created this way will be drawn using our internal tiling/pyramid logic - they will be rendered at a lower resolution if you zoom out and will increase in resolution the closer you zoom in.

    This method requires the least amount of code, but there are several other ways of doing this with varying degrees of complexity and flexibility. Let me know if this doesn't produce the visuals you want to see.



    ------------------------------
    Arturas Grigorjevas
    ------------------------------



  • 9.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 18 days ago
    Edited by Fernando Calvo 18 days ago

    Hi Arturas,

    thanks a lot for the info and code. I adjusted it to my IronPython code and it works great:

    wv = self.currentProject[Project.FixedSerial.WorldView]
    image = wv.Add(clr.GetClrType(RasterImage))
     
    image.Origin = Point3D(10,10,10)
    image.ImageFile = "C:\TestImage.png"
    image.ImageWidth = 384
    image.ImageHeight = 216

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 10.  RE: questions regarding OverlayBag for showing WMTS tiles

    Posted 18 days ago
    Edited by Fernando Calvo 18 days ago

    Hi again,

    I tried several times to add more images to explain what I tried but the post is not uploaded, so trying now with only text.

    I was playing with some other higher res images and the first zoom does not show too much, and you need to get very close to the pixels in order to see something.

    Could you please advise on additional advanced ways to handle this in a better way?

    Thanks so much for your support !

    Regards,

    Fernando



    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------