Can Google Earth and Google Maps get live data using KML files? - javascript

I've read a little about KML files. They are XML files that can be opened in Google Earth and Google Maps to display all kinds of data on the map. I have created a Google Maps application that displays thousands of dots representing thousands of IP addresses. The dots are red, yellow and green, depending on if they're offline, unstable or online respectively. The dots are also refreshed once per 5 seconds.
I was intrigued by the mention of KML files, seeing as they can be opened in Google Maps and Google Earth both. I have a few worries that I couldn't answer by Googling though:
Can Google Earth be set to update the KML file from a URL live? That way the dots would change colours in the application without the user having to manually
If I were to change my application to using KML files, would it still be a simple matter to fetch information about each dot using javascript?
How does creation of Information Windows work in KML files?

You need to read about NetworkLink on NetworkLink
This element can load KML(KMZ) from url.

Related

Display offline ArcGIS Esri map using Leaflet

I need to display ArcGIS ESRI map hosted in intranet environment.
I was following this example and it works fine when system is connected to internet.
As our Map Server is hosted in intranet environment so I cannot use above example.
I have further investigated ESRI leaflet and found out that its making calls to online arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer for loading map tiles. I replaced this URL with our Map server URL
https://{our domain}/intsrv/rest/services/Cache/StreetsNightBlue/MapServer but still tiles are not loaded.
I have added all required CSS and JS files offline in my project already.
mapObject = L.map('mapDiv').setView([defaultLat, defaultLong], defaultZoom);
L.esri.basemapLayer('Gray').addTo(mapObject);
L.esri.Cluster.featureLayer({
url: 'https://{our domain}/intsrv/rest/services/Cache/StreetsNightBlue/MapServer/0'
}).addTo(mapObject);
When I run program, in console it giving tile not found error.
Update: Tiles appearing now but far away from marker cluster
Kindly help to fix this issue.

Use the standard google maps interface on embedded maps / google maps API

This surely sounds like a silly question in my head, but I want to put it out there nonetheless just to make sure I haven't missed anything.
I've got a page on my website that has a google map (currently 'embedded' through the google maps api v3).
While I'm perfectly capable of interacting with that map through a custom form (and the google map api):
an input box to set starting point
an input box to set endpoint
a dropdown list for transportation modes
I was wondering if it was possible (in comes the silliness) to use google's own interface for this (cause users are used to this).
Abstracting my question: Is there a way to "bring in" Google Maps' own UI on an embedded map and do some calculations on my own page, based on the routes (/modes of transportations, etc) that are being selected in that UI.
My guess: no. The google maps UI is something that can only show up on maps embedded with an iFrame (so only on maps.google.com) and no interaction with it is possible, at least not in a kosher way.
There is the direction API which you can use to obtain responses (JSON or XML) regarding useful information such as distance, start coordinate, travel mode, etc. You can interact with the response to obtain what is needed for your web page.
I have posted a link for the direction API. Hope this can help.
Direction API

Is there any way for javascript to plot kml or gpx data?

Let's say I have a site where local users can upload their favorite hikes to share. But some users don't have the ability to get gpx or kml data.
Are there any open source options for the users to plot their own hikes, like in a google maps window?
If not, what would be the best way to go about doing this, if any?
Thanks for your time.
You can use the Drawing Tools in the Google Maps Javascript API v3 to plot the hike, then convert that data to KML or gpx.
proof of concept built from a previous version of blitz-gmap-editor, there were some changes made to it since I took that snapshot.

How to prevent Google Maps API v3 from caching tiles (to save storage space)?

I have a strange issue regarding caching of the Maps js API for which I couldn't find any solution.
My situation is as follows:
We want to display a simple website including a map based on Maps API v3.
The website shall be displayed on an embedded device which uses a modified WebKit engine.
Therefor displaying and using Google Maps works great.
But here comes the problem:
Our embedded device has only few storage space (maybe a few 100 KBs).
The Maps API caches every map tile (which usually makes sense!!!), so after the user is moving around the map for some time, we get an error that the cache is full.
Is there any possibility to tell the Maps API not to cache the tiles, to only cache a specific number of tiles, or even to remove the cached tiles programatically by ourselves?
I couldn't find any approach or solution regarding this issue, so it would be really great if somebody has an idea.
Thank you in advance
Markus

Get iPhone location data into a Google Maps

I am looking to develop a feature for a browser app I am developing. I was hoping to get any advice on this topic:
A user walks around with their iphone.
During this time location data is recorded of their walk
This data can then be exported to Google Maps and I can see the route overlaid on a Google Map in my browser.
Is this possible? Where would I start and how would the data be recorded?
Yes, this is possible (assuming you want to use Javascript as it is tagged to your question).
Getting the location data on an iPhone is possible, see this question. You can use the Google Maps API to display a map and draw the recorded path on it. I would rather display the walked route direct in your app rather than exporting/importing coordinates of the recorded route.
Before implementing the App, I would take a look on both Google Maps API and OpenStreemMap API to find out which you like more and fits your needs best. Playing with some examples before implementing your app might be a good point to start with.

Categories

Resources