I'm currently making an application where I use google earth to display a path. This path will be updated on a regular basis, and I've used a network link to connect the google earth to a KML file.
The problem is that every time google earth recieves an update from the KML it resets the view. I would like to disable this feature, but still be able to "fly" to a specific location on startup.
I've tried using setFlyToView(false) on the network link, but this results in no flying at all. What I would like, is for google earth to fly to the location of the placemark at start, and then when it updates -from the KML file through the network link- it doesn't fly anywhere.
Is there a way to access and change options when google earth is already running? If it's possible I could then use the setFlyToView(true) at initialization and then setFlyToView(false) when google earth has already changed the view to where I want to be, thereby disabling the updating of the view, but not the initial view position.
Thanks in advance!
That is the behavior if you have flyToView set 1 in the NetworkLink. Check that the flyToView element is child of the NetworkLink not the Link. Possibly the KML being generated by the JavaScript API you're using is not setting the flyToView correctly or it isn't supported.
<Document>
<visibility>1</visibility>
<NetworkLink>
<name>NE US Radar</name>
<refreshVisibility>1</refreshVisibility>
<flyToView>1</flyToView>
<Link>...</Link>
</NetworkLink>
</Document>
Also, you may want to override default view with a LookAt or Camera element added to the NetworkLink to fly.
Related
I am currently having trouble getting started with writing an extension that shifts the viewer to a pdf view. More or less, the extension button in mind, when clicked/activated, makes the viewer look like the first image here, and when it is clicked again/deactivated, it reverts back to the regular 3D viewer.
I tried looking into the code in the above link but I don't understand where the modelDocument object came from. I am using the Forge Viewer completely offline, so I am not dealing with any URNs, authentication mechanisms, etc. I already wrote extensions that can change the 3D model in the browser in some way, but this new extension is different.
Thank you in advance!
The viewer can only load multiple models at a time but they have to be both 2D or both 3D, you cannot load a 2D model in the same instance if you loaded a 3D model.
You could simply instantiate a 2nd viewer that will load the pdf view, either overlay a div, or navigate to another page or display it side by side like in my demo. That's really up to you.
If you use the viewer offline, then I'm assuming you somehow downloaded the viewable resources that correspond to the translated pdf, in which case you can simply load a 2D model the same way you load the 3D one, using viewer.loadModel('path/to/your/.f2d/resource').
Hope that helps
Using python I have managed to extract the exref data (lat, long, etc) of photos into a pandas dataframe. I then generate a leaflet/folium map html file, which when opened in a browser, displays the georeferenced points where the photos were captured. Clicking each opens a popup displaying filename, as per the following:
for lat,lon,Filename in zip(df['Lat'],df['Lon'],df['Filename']):
fg.add_child(folium.Marker(location[lat,lon],popup=Filename,icon=folium.Icon(color='red')))
However, what I would like to do is display the actual images in the popup. Is it possible to do this with locally stored images - perhaps by specifying the filepath+filename? Web searches have returned a number of solutions for using web-hosted images by referring to url's, but I would like to use this as a way to navigate through offline photos if possible.
Happy to hear of alternative solutions if this simply isn't an option with Leaflet.
Since popup takes a string, wouldn't fg.add_child(folium.Marker(location[lat,lon],popup="<img src='file:///"+MY_FILE_PATH + Filename + "'>",icon=folium.Icon(color='red'))) work well for your scenario?
For anyone else looking, I eventually managed to get this working through a combination of snkashis's suggestions and the instructions contained within the following thread:
https://github.com/python-visualization/folium/issues/604:
Backgroud:
I am using polymer framework to create a map service web app. And my map element is put inside iron-pages.
<iron-pages attr-for-selected="id" selected="{{data.page}}">
<main-page id="main"></main-page>
<test-page id="page"></test-page>
</iron-pages>
And the map element is inside the <main-page id="main"></main-page>
All the map settings are right , but the map is displaying like this:
enter image description here
Issue:
Just like the image above , the leaflet map is not fully loaded. However, when I resize the browser window, then the map loaded perfectly. It seems like the trigger to load the map became my resizing action?
My trials:
I tried to search others answer , https://github.com/Leaflet/Leaflet/issues/694
But when I execute map.invalidateSize() , the console says "invalidateSize() is not a function".
I tried to put <main-page id="main"></main-page> out of <iron-pages> which forsake routing feature temporarily for testing, and the map works perfectly.But What is the real issue in this circumstance?
I am very new to polymer, I am not sure where is the issue come from?
Could you please give me any suggestion?
Thank you!
I have a website.
http://shipm8.ship2you.co/contactus
I have to change the icon that is appearing on the map, but I don't know where that icon is located.Can anybody help?
view-source->main.js->http://shipm8.ship2you.co/images/marker.png
When you check page source (right click-> view source), you should find image URL there. If you can's see it, itis most likely it is served by JS from some file. My assumption was to check custom (not known library seen there) file and first one to check was main.js file. In that file you would search for block of code that is responsible for google map. Actually first logic thinking for you should be to check google map code - where is called, calculated, executed... So there you can follow URL for marker. I noticed it is relative URL and just being appended to base url it showed image as well.
Is it possible to embed google map with custom markers to a website just by iframe? I have google map on my website with markers and everything is working with some functions in javascript. It's okay but now I want to enable some users to add same map with same markers to their website. I want to do it very easy and with less code possible. So I want to give code to users that they add to site and everything would work. Is it possible with just iframe tag? Or I must give users code in javascript too? Or is there another way? Thanks
You may use Mapsengine to create the map, they may easily be shared via iframe. But there is no option to apply custom script-code.
Another approach: use a script-file that contains the code used with the map and that also creates the map. The users may embed this script instead of an iframe, the sharing would be as simple as when you would use an iframe.