How to check KML layer has active feed or not? - google-maps

I created a KML layer for the URL - http://www.nhc.noaa.gov/gis/kml/nhc.kmz.
This layer is applied on the map and I could not see any layer. The reason is there is no active feed for this KML layer.
Is there any way to check if the KML layer has the active feed or not?

If a feed is not active (meaning the URL fails to load) Google Earth will show the NetworkLink icon with a red network link error icon. The status of network link fetching is shown with different icons as shown below:
Also note there are two validation errors in the KML, both in the target KML.
URL: http://www.nhc.noaa.gov/gis/kml/nhc_active.kml
1) The NetworkLinkControl expires time is formatted in a non-KML date format.
<NetworkLinkControl>
<minRefreshPeriod>120</minRefreshPeriod>
<expires>Thu, 28 Mar 2013 17:01:37 UTC</expires>
</NetworkLinkControl>
The kml:DateTime field is defined as the following:
<simpleType name="kml:dateTimeType">
<union memberTypes="dateTime date gYearMonth gYear"/>
</simpleType>
Recommend the ISO-8601 format: YYYY-MM-DD'T'HH:MM:SS'Z'
like this: 2013-03-28T17:01:37Z
References:
http://www.w3schools.com/schema/schema_dtypes_date.asp
http://www.w3.org/TR/xmlschema-2/#dateTime
2) The Document has a name defined twice. The second name appears it should be enclosed with a missing <Folder> element.
<Document id="active">
<name>Current Forecasts and Data</name>
...
<ScreenOverlay id="activeLegend">
</ScreenOverlay>
** following 3 tags don't belong here ***
<name>Active Tropical Cyclones</name>
<visibility>1</visibility>
<open>1</open>
</Document>
Recommend using a KML Validator to validate KML when it does NOT work like you expect it to.

Related

How to find fid from cid in google place?

I need "fid" of google place if I have "cid"
CID: 13044706322416579131
FID: 0x395e84f3f650771d:0xb5081b4952eeb23b
As I found 2nd portion (0xb5081b4952eeb23b) of fid is hex of cid (13044706322416579131).
But I can't find how to get 1st portion (0x395e84f3f650771d)
First, you would start by locating the Google Plus Local page.
You then click the ‘Edit business details’ link on that G+ Local Page. That URL can then be transposed into a Google Maps (Google Places) URL such as in this example:
visit a Google+ Local page, such as: https://plus.google.com/109929267125901378263/
click ‘Edit business details’ on the G+ Local page
copy the first part of the URL on the page that appears after clicking on ‘Edit business details’.
paste the URL into a text file and you end up with a URL similar to this (but longer): https://maps.google.com/maps/place?cid=4851990417008427082&mode=edit […]
remove the text: /place … and remove anything after the CID # (meaning: remove ‘&mode’ and anything after it)
You end up with a Google Maps URL such as this, which you can bookmark for reference sake: https://maps.google.com/maps?cid=4851990417008427082. You would then finish the process by doing this:
copy the part that says cid=################### and paste it after this partial URL: www.google.com/mapmaker?gw=90&
the result is a Google Map Maker URL such as: www.google.com/mapmaker?gw=90&cid=4851990417008427082 (I call that the ‘gw 90’ GMM POI URL.)
However, it is often useful to have another version of the URL in the format of: www.google.com/mapmaker?gw=39&fid=. (I call that the ‘GW 39’ or the ‘FID’ version of the GMM POI) such as this: www.google.com/mapmaker?gw=39&fid=0x8804fe4c222357a7:0x692b02e73b5dc33b
Referred from here.

Example of World File

Does any body have an example of map world file, where it shows the input parameters including the latitude and longitude and the output world file.
I Google for world file, I found an explanation but I didn't see a full example.
Thanking you.
See this page:
http://en.wikipedia.org/wiki/World_file
It explains the format very well and it has also a World file example in UTM coordinate system. It is typically a text file with extension .wld and 6 lines such as:
32.0
0.0
0.0
-32.0
691200.0
4576000.0
You have on your question the tag "maptiler". If you want to create Google Maps compatible tiles with MapTiler then you don't need to define the World file, there are now also other options for how to assign location to an image. See http://www.maptiler.com/how-to/georeferencing/

Geoxml-V3 icon request path repeated in request

Im trying to migrate form geoxml to geoxml-v3 and also google maps v2 to v3. The issue I'm having is with geoxml-v3. The icon request generated on the client from geoxml-v3 is garbeled. For example
localhost/app/resources/icon.png
will become something like
localhost/app/resources/app/resources/app/resources/app/resources/icon.png
These kml files work with geoxml and are correctly formed. The style icon segment is
<Style id="off-red">
<IconStyle>
<Icon>
<href>resources/icon.png</href>
</Icon>
</IconStyle>
</Style>
I figured out its a problem with geoxml-v3 library, well at least in my circumstance where I want to store my own marker icons. There is some code, line 386
if (typeof this.url == "string")
which prefixes the icon url with the current context or else the last used context. Didn't look into it to much. Commenting out that if block will lead to correct request.
This is a hack but works for my requirements.

how to toggle between KML files in Google Earth or toggle between sets of points

so basically I have a KML file that I load up, and I have 2 different sets of points that I present on there. However, I want to be able to present one set at a time, I figured the simplest way to do this is to split the set into 2 different KML files, and then load the appropriate file depending on set, or if there is another way of doing this, it could work for me as well.
Thanks a lot.
While kaliatech's answer is correct and useful, it is also a bit of overkill and harder to implement than this approach. It is a Google example and toggles the loading of various KML files via checkboxes.
All you need to do is change the filenames of your kmls to red/yellow/green OR change to code to names more specific to your use - depending on how comfortable you feel and what ythe end result you want is.
There are number of ways to do this if you are familiar with JavaScript and can make use of the Google Earth API.
This is an example of hiding/showing a folder within a KML file if the folder has a known ID:
var showFolder = true;
google.earth.fetchKml(gePlugin, kmlUrl, function(rootKmlFeature) {
if (rootKmlFeature) {
var myFolderEl = rootKmlFeature.getElementById('#myFolderId');
if (showFolder) {
myFolderEl.setVisibility(true);
}
else {
myFolderEl.setVisibility(false);
}
}
});
The root KmlFeature is always a KmlContainer which provides methods for looking up child elements. Note that it can be difficult to know whether or not you need to use "getElementById" or "getElementByUrl". The google documentation isn't particularly clear:
https://developers.google.com/earth/documentation/reference/interface_kml_container
Once you have a reference to the folder (or relevant KmlFeature), you can set the visibility (and many other properties) dynamically in response to UI events or whatever.
Edit (after your comment)
The fetchKml callback (in the HTML) provides you with the loaded kmlObject. Depending on how you want to trigger the show/hide interaction, you probably want to store that kmlObject in a higher (perhaps global) scope. Then, when user presses button, or whatever, you can do something like this:
function displayPlacemark1(visible) {
var baseUrl = 'https://sites.google.com/' + 'site/shahinkmlexamples/experiment/bombs12.kml';
var placemark = kmlObject.getElementByUrl('#placemark1');
placemark.setVisibility(visible);
}
Correspondingly, in your KML file, you want to add an id attribute to the placemarks. i.e.
...
<Placemark id="placemark1">
...
The solutions above describe the Google Earth API approach with JavaScript.
The pure-KML solution is to add a radio button via a ListStyle to a Folder in your KML then have each set of points in a sub-folder or NetworkLink link. You can make one of the sets visible by default by adding <visibility>0</visibility> element on the other sub-folders you want not shown initially. Another trick is having an empty first feature with instructions in the name or description to select radio button to view the other sets. You can find this used in the Google Maps Overlay in Google Earth.
radioFolder when specified for a Container, only one of the Container's items is visible at a time.
Here's example of KML using a radioFolder with two sets of Points:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="rf">
<ListStyle>
<listItemType>radioFolder</listItemType>
</ListStyle>
</Style>
<Folder>
<name>Radio A visible by default</name>
<description>Select which folder to see</description>
<styleUrl>#rf</styleUrl>
<Folder>
<name>Folder A</name>
<Placemark>
<name>Radio A</name>
<Point>
<coordinates>-121.9921875, 37.44140625</coordinates>
</Point>
</Placemark>
</Folder>
<Folder>
<name>Folder B</name>
<visibility>0</visibility>
<Placemark>
<name>Radio B</name>
<visibility>0</visibility>
<Point>
<coordinates>-121.9921875, 37.265625</coordinates>
</Point>
</Placemark>
</Folder>
</Folder>
</Document>
</kml>
Reference:
https://developers.google.com/kml/documentation/kmlreference#listItemType

Showing Google Maps in OpenERP

I wanted to include Google maps in a module of OpenERP. As far as I know until I use iframe tag of HTML I wont be able to show Google maps in OpenERP but in OpenERP I have only two kinds of file one is .xml and other is .py. Now how am I supposed to add iframe with only these two file in hand. Any ideas ?
Thank you
There is module called google_map in openerp addons. Install that module to get the google map inside openerp and if needed make the necessary changes by creating your own custom module
In the 2012 OpenERP Days one of the presentations demonstrated how to craete a custom Webclient widget. The example used was a geo widget that could display and address as a Google Map indide a froam view. The code is available here.
You can try out Camptocamp's geoengine addon. This addon is meant to display data from the OpenERP database in a custom view using a map. It does not use an iframe to embed a googlemap, afaik.
https://launchpad.net/geospatial-addons
This is an example for openning the map in a new link where the html file which contains the html and java script code for the google map located in
static/src/googlemaps/get_place_from_coords.html
and the following method will be called when clicking the open google map button in the openerp interface:
def button_open_google(self, cr, uid, ids, context=None):
for place in self.browse(cr, uid, ids):
url="/tms/static/src/googlemaps/get_place_from_coords.html?" + str(place.latitude) + ','+ str(place.longitude)
return { 'type': 'ir.actions.act_url', 'url': url, 'nodestroy': True, 'target': 'new' }