Keeping several description balloons open at the same time in KML/Google Maps - google-maps

So I defined a Maps overlay with several placemarks to visualize research I'm doing. The descriptions have the results in them, and all works nicely. But when I open a balloon, the previously opened one closes, so that there's no real possibility to compare the results over the different placemarks.
I looked at the KML FAQ for this, and it says it's not possible to have a description open when the KML is opened.[1] It also says to use feature anchors to have another balloon open when a first one is opened.[2] But this would mean I have a fixed set of balloons to open at the same time, while I'd like the viewer to decide which ones are open at any given time.
So is it possible to keep them from closing when I open another balloon? If not, is there another possibility to display text info for several places at the same where the viewer can decide on which placemarks are open?
[1] https://developers.google.com/kml/faq#balloonopenfile
[2] https://developers.google.com/kml/documentation/kmlreference#featureanchor

Here's on option:
When you create the KMLLayer, set the suppressInfoWindows option to false. Then add an event that captures the click event: [https://developers.google.com/maps/documentation/javascript/reference#KmlMouseEvent][1]
That gives you access to the featureData, [https://developers.google.com/maps/documentation/javascript/reference#KmlFeatureData][2]
which gives you access to the infoWindowHtml. With that, create your own InfoWindow at the latLng of the click. Create a new one for each click, so that they'll stay open.

Related

QGIS Cloud: Show Multiple Attributes in Popup

I'm trying to work with creating a web map in QGIS Cloud Free using QGIS 3.28.2 (Firenze). Trouble is, I cannot figure out how to show a full list of attributes when I click on a feature and open the popup window. In my layer's properties under Display, I can decide what single attribute will show up as the title of the popup, but that isn't enough. I want to see the full list of attributes for that feature. This should be super straightforward but it isn't.
How do I configure my map to show a list of attributes in QGIS Cloud? (I know you can set information in the HTML Map Tip, but that's not the same as the popup. If I'm on a mobile device, I can't access the map tip).

Controlling the autodesk-forge viewer with external buttons

Currently I am adding forge to an internal company website where we can view all of the machines we have built or are building. The website works like this: The user selects a machine number and all the information about the machine will pop up. This includes stations within the machine, as well as all the individual parts within each station. My task was to add autodesk-forge to the website. Currently I have successfully used the autodesk-forge viewer so that whenever a machine is picked, the user can press a button, and the model of the entire machine will pop up to be viewed. The next step is to have the viewer be controlled by external buttons on the website. We want it to work as such:
A machine is picked by the user. After this all the information such as stations, and parts within each station in the machine will pop up (this is completed).
The user clicks a "view model" button which will use the forge viewer to make the machine pop up on the website (This has been completed by me).
Once the forge viewer with the model is on the screen, we want the viewer to be able to be controlled by external buttons already on the site.
For example, if there is a machine with name MC-000, and in that machine there is a station named ST010, within that station there are many parts, for example a gear. When the machine MC-000 is being viewed by the user, we want to be able to click an external button which is already made (for example ST010) and the viewer will automatically zoom in and highlight that station within the machine. We also want the same for parts within the machine. When a machine is picked, its stations, as well as the parts within the stations are already printed out within our website. We now want to be able to click the stations, or parts and have the viewer automatically zoom into that part# or station#. I have found a similar code sample here. In this example, parts of the viewer are controlled by buttons not within the viewer. For example, when the 'engine' button is clicked, the viewer will automatically zoom into the engine. The problem with this example, is that all of the positions are hard-coded into the code, meaning that the position of the engine is already within the code. I cannot do this as we have many different machines with thousands of parts, so it would be impossible for me to hard-code them all in. Is something like this possible to do with autodesk-forge viewer. Any help or guidance would be greatly appreciated. Cheers!
EDIT**
Any guidance at all on how I can change where the viewer zooms into would be much appreciated and would help a lot. Currently, I have methods go get both the dbid, and the external objectId from the GET :urn/metadata/:guid http request. Thanks again!
It seems you do have the specified engine dbid and you have a way to link viewer functions with your outside code. The default doubleclick behaviour of the viewer is to select the item the mousepointer collides with. The camera then zooms in (or out) to that item to fit it into the view.
You can use:
select
And
fitToView
To achieve a simular interaction.
For example in Typescript:
// Your dbid is for example 1234
this.viewer.select(1234);
this.viewer.fitToView([1234]);
viewer.select(dbid);
viewer.utilities.fitToView();
Example: https://github.com/Autodesk-Forge/forge-extensions/tree/master/public/extensions/IconMarkupExtension

Google Maps : create (short) URL to current view & location?

Google Maps used to have a feature to create a link (short URL) to the current view and location. However that doesn't seem to be there anymore...?? Is that gone or how do I do that?
I mean not just a link to a specific search query, i.e. like maps.google.com/maps?q=<address> or maps.google.com/maps?q=<lat,lon>, but when moving around, having a certain view and zoom level and everything, you could do 'Create link'. With a checkbox 'create short URL` which resulted in URLs like http://goo.gl/maps/AbCdEf.
Anyone knows where I can find that feature now?
Left to the search box you'll find the following icon:
Here you find the option for sharing the link to the current view, also for short links.
It has changed in the latest version of Maps: If you click on the "Share" Icon in the route details section - it allows the same thing - select "Short URL" and off you go...

How does Google Docs map mouse coordinates to text offset (for drag and drop)?

I've spent some time searching SO for mapping mouse coordinates to text offset (for drag and drop), but the only solution I've come across is to wrap each character in its own span so that you may monitor mouse events on that span, which is not a scalable solution (for large documents).
But moreover, Google Docs is able to track the mouse cursor as it drags text around (drawing an insertion point in the text where the mouse is). From monitoring the DOM at and around the text, it doesn't appear to be using the character-span technique. Does anyone know how this is accomplished?
Unfortunately I don't have a Google account so I can't check what Google uses to accomplish Google Docs. But for obtaining the selection source you could be interested in this answer.
You also mentioned drag and drop. HTML5 supports an attribute called "contenteditable". The browser makes it (like the name implies) editable for the user. Here is a nice example.
To see how an editor (for example CKEditor or maybe even Google Docs) can be written with HTML 5 techniques, read http://www.quackit.com/html/codes/contenteditable.cfm.

Take a picture from google streetview

Is it possible to embed streetview for an address. Then user will move around in streetview with zoom, pan etc and finally can we provide user a button which will capture the image and send to an application. Alternatively, if it is not possible to use the button and capture an image of what the user sees then, we can we take a streetview link from the user like this one and then can we get the image on php similar to what is shown in flash?
The whole idea is to be able to get what user sees on streetview as an image to the server.
Have a look at StreetView.py This python script parses all panorama information.
yes,you can use iecapt.exe which will capture a particular div area.
you can check on the following link
capturing webpage using iecapt