Google Earth KML - href fragment URL getting cut off at the # - won't open in browser - url

I have a KML file that includes a list of placemarks. In the placemark description I have links that point to a webpage I want users to open in a browser. The href points to a fragment URL, meaning it has a '#' as a delimiter, followed by a parameter related to the placemark. When I view the placemark balloon I see the clickable link, but when I click it sends the URL to the browser cutting off the '#' and the parameter that follows. However if I right-click on the link, copy link location, and paste it into a browser it works fine...I'd like to avoid those few extra steps though.
The link looks like this: mywebsite/directory#12345678
but it opens in the browser like this: mywebsite/directory
which doesn't work.
From some searching around I see the # is used to enable fly to features (see below). Is there a workaround or fix so that I can make google earth send the complete fragment URL to the browser, without cutting off the # and parameter?
--from Google Earth deveopers group
Other Behavior Specified Through Use of the Element
KML supports the use of two attributes within the element: href and type.
The anchor element contains an href attribute that specifies a URL.
If the href is a KML file and has a .kml or .kmz file extension, Google Earth loads that file directly when the user clicks it. If the URL ends with an extension not known to Google Earth (for example, .html), the URL is sent to the browser.
The href can be a fragment URL (that is, a URL with a # sign followed by a KML identifier). When the user clicks a link that includes a fragment URL, by default the browser flies to the Feature whose ID matches the fragment. If the Feature has a LookAt or Camera element, the Feature is viewed from the specified viewpoint.
The behavior can be further specified by appending one of the following three strings to the fragment URL:
•;flyto (default) - fly to the Feature
•;balloon - open the Feature's balloon but do not fly to the Feature
•;balloonFlyto - open the Feature's balloon and fly to the Feature
I'd greatly appreciate any ideas, suggestions, or workarounds!

If the target URL "mywebsite/directory" results in an HTML document with a target id defined with appropriate anchor (e.g. 1234578) then it normally can be accessed via clicking a link via KML from Google Earth.
There may be an issue with how the URL is escaped in the KML. Wrapping HTML in the feature description via CDATA block sometimes helps.
Here's where having a '#' in the URL for a link in KML works as you'd expect.
KML
<?xml version='1.0'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Placemark>
<description>
<![CDATA[
Visiting a linked resource.
See reference
]]>
</description>
</Placemark>
</kml>
Target HTML links.html
<html>
...
<h3><a name="h-12.1.1">12.1.1</a> Visiting a linked resource</h3>
...
</html>
The behavior might be different whether the web browser is configured as external or internal to Google Earth. In Tools/Options/General menu check/uncheck the option "Show web results in external browser" to see if the action changes.

Related

AEM - External links appended to current page

When adding external urls in any component with field, say pagefield or pathfield, it doesnt open the external link, but appends it to the current path
eg: property given - http://www.google.com
when clicked, it goes to
http://localhost:4502/content/wknd/home/us/en/test456/http://www.google.com
is there any setting or config?

Inconsistent results trying to parse og:image tag from a webpage manually and programmatically

I first manually browse to the below URL:
Mounting injuries won't stop Germany's path to World Cup
Then if view the page source and look for og:image meta tags I find the following:
<meta property="og:image" content="http://l.yimg.com/bt/api/res/1.2/JjwtkhIEdT9nKxLp8p0LFQ--/YXBwaWQ9eW5ld3M7cT04NTt3PTYwMA--/http://media.zenfs.com/en_us/News/Reuters/2013-10-08T122032Z_1_CBRE9970YAZ00_RTROPTP_2_SOCCER-WORLD.JPG"/>
However, if I try to parse the same url programmatically, I get a generic Yahoo stock icon. Here is the code that I am using:
string url = "http://sports.yahoo.com/news/mounting-injuries-wont-stop-germanys-path-world-cup-122032650--sow.html";
WebClient wc = new WebClient();
var doc = new HtmlAgilityPack.HtmlDocument();
string newsPageSource = wc.DownloadString(sourceUri.ToString());
doc.LoadHtml(newsPageSource);
...
(I have removed the rest fro brevity).
If I debug here and inspect the newsPageSource string that contains the content of the target web page and look for og:image tag, its contents are different:
<meta property="og:image" content="http://l.yimg.com/bt/api/res/1.2/81I5U991YW6EEaB2Cjd58g--/YXBwaWQ9eW5ld3M7cT04NTt3PTYwMA--/http://l.yimg.com/os/mit/media/m/social/images/social_default_logo-1481777.png"/>
So not sure what is going on here. I guess, when browsing manually, the original URL is probably redirecting to some other internal URL but when doing this programmatically, the code just grabs the first "snapshot" of page source, without waiting a bit longer and executing any redirects. Can anyone shed light here? Or better yet, how would I extract the real image (2013-10-08T122032Z_1_CBRE9970YAZ00_RTROPTP_2_SOCCER-WORLD.JPG) in this case instead of getting a Yahoo stock icon (social_default_logo-1481777.png).
Somehow Facebook and Google+ are smart enough to extract the correct image when I paste the same link.
Thanks,
Archil

Google index MVC URIs in a long-page context

I have a long page comprised with a set of modules with their own URI
Example
Page URI
http://mysite/index/product
Module URIs
http://mysite/index/product/specifications
http://mysite/index/product/features
Now what I would like to do, is when a user searches for "features", then Google would display the content from the individual module in the search results, but when the user clicked the link, it would actually take them to the "features" section within the context of the "product" combined page.
I've tried a test using a canonical link back from the module URI to the main page but Google simply indexes the content in the full page.
How would one approach this? I'm sure it's possible?

HTML Urls - how to append to the existing url

This is a stupidly easy question, however after searching for a long time I have yet to yield any results.
My question is as follows.
I have a webpage with the url http://domain.com/mypage/ladeda/
I have a link on this page.
Page 1
That link sends me to http://domain.com/1/
Page 1
That link takes me to http://domain.com/mypage/1/
How do i get my link to take me to http://domain.com/mypage/ladeda/1/
without having to extract all the aspects of the page url and put them within the href.
Many Thanks
<base href="/mypage/ladeda/" />
...
(goes to http://domain.com/mypage/ladeda/1/)
Via the <base> element.
But!
Page 1 should take you to http://domain.com/mypage/ladeda/1/ already provided that (a) you don't use a <base> element already and (b) the current resource is really http://domain.com/mypage/ladeda/ (with a trailing slash).
Page 1
If the current page isn't in the same directory (real or virtual) as the target page, you're going to have to specify a complete path. Either relative, or absolute. There's no way around it.

Adding a trailing slash after url moves the box below the menu & logo over it

I am using codeigniter.
My products page shows all the products we have and then users can click on each product_name to get more details about that particular product. So, I have declared products as the class and product_name as a function within the product class - so I could get the url www.company.com/products/product_name.
When I go to www.company.com/products everything is fine but if I add a trailing slash so it looks like www.company.com/products/ my window underneath the logo and menu moves over it hiding both the logo and menu. The same happens when I go to www.company.com/products/product_name.
How can I make sure that the window below does not hide when I add trailing slashes or when I go to product_name pages.
Any help would be appreciated.
The problem is that you have specified a relative path for your images. You need to make them absolute, or at least relative to the current location. That is to say, if you change your image path from:
<img src="images/obsia.png">
to
<img src="/images/obsia.png">
or
<img src="http://www.obsia.com/images/obsia.png">
Your problem will be solved.
The reason this is happening is because the path to the images is determined by the base URL. When you are at http://www.obsia.com or http://www.obsia.com/products, your base URL is http://www.obsia.com.
To the browser then images/obsia.png is rendered as http://www.obsia.com/image/obsia.png, which your server interprets as wwwroot/images/obsia.png and the relative link works.
However, if you do http://www.obsia.com/products/ your base url is http://www.obsia.com/products and the relative path for your images changes from http://www.obsia.com/images/obsia.png to http://www.obsia.com/products/images/obsia.png.
Your server interprets this as , which your server interprets as wwwroot/images/products/obsia.png, which is not a valid path. The server returns a 404 --resulting in broken images.
You can see this if you use Firebug's .Net panel. The request for your logo returns:
GET obsia.png
http://www.obsia.com/products/images/obsia.png
404 Not Found
obsia.com
539 B

Resources