Google Maps (API) within SketchUp

I am trying to implement a dynamic google map (javascript API) within one of my HTML menus in SketchUp.

As you can see below I got it to work in SU 2017 however for some reason it does not seem to work in SU 2022. Obviously something is different with the built-in browser but sadly I am not getting any error messages in the console log so I am at a loss as to why it works in one but not the other.

Has anyone ever tried to implement Google maps within SketchUp like this, if so what is your experience across the different versions (2017 - 2022)?

Since I am not seeing any syntax or other similar errors in the console I am wondering if the browser in SU 2022 is more locked down in some respects and does not allow the Google Maps API to load correctly.

At this point I really have no idea and I’m kind of grasping at straws.

I think someone with a higher pay grade than myself needs to figure this one out.

Maybe there is a better (or free) mapping API that works within SketchUp, suggestions?

I really don’t know squat about this… but wonder if it has something to do with the agreement between Trimble and Goggle over the use of Google maps ending some years back ?

1 Like

I’m hoping maybe someone from the SketchUp team can give me a little insight into what might be happening here.

In the meantime I might try to see if I can implement a Google static map within SketchUp.

When you say it doesn’t work, what do you mean more specifically.

1 Like

I fiddled with it some more and then all of a sudden it works. So it appears that the Google Maps API does work within SketchUp. :slight_smile:

Checked it in both 2017 and 2022, so far so good.

2 Likes

However on a related note I am trying to use cookies within the HTML menus and I do not seem to be able to write cookies. Is there any documentation on HtmlDialog and the use of cookies?

I’m not seeing anything in the Ruby API documentation.

I also tried some searching around for setting and reading cookies within CEF (Chromium Embedded Framework), but what little I found was less than helpful.

This previous thread seems to be related but the questions on cookies did not seem to be clearly answered:

After giving this problem some thought I realized I don’t really need to use cookies, I can just send and retrieve the same information from Ruby and store the would be cookies as an attribute library somewhere.

If someone does manage to figure out cookies though, please post a follow up here.

Are you trying to writing cookies from a file:// URL? And across domains? I’m guessing you might be running into cross site issues.

1 Like

If the data is model specific a dictionary would be ideal, if not then save out a JSON file to the user’s AppData path.

With Cookies you can not know when the user might clear out their "Temporary Internet Files" folder.

1 Like

Cookies made the most sense for web pages hosted on my server but I actually now think a call back to the Ruby API and storing these sorts of parameters in an attribute library is a better solution and as Dan suggests, a more controllable solution.

1 Like