Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with loading KML files in ios #207

Open
gchristakis opened this issue Jan 11, 2016 · 9 comments
Open

problem with loading KML files in ios #207

gchristakis opened this issue Jan 11, 2016 · 9 comments
Labels

Comments

@gchristakis
Copy link

i have made an app with ionic framework leaflet and KML and i have problem to load KML files in ios, in browser and android everything is OK.

do you have an idea why this happening?

@egmobile
Copy link

Hi, I had a similar problem working with leaflet and Cordova in iOS. Did you find a solution? Thanks in advance.

@gchristakis
Copy link
Author

for the ios i had to tranform kml files to geojson files and load them as geojson
that was the only solution that i found

@egmobile
Copy link

Thanks a lot, I will try that and let you know just for reference.

Kind regards,

--Dimitris Doukas


logo

Dr. Dimitris Doukas

General Manager Twin Net Information Systems Ltd

Mob: +30.6944.964310

Phone: +30.210.6857070, +30.210-6090451

Fax: +30.210.6857070

Web: http://www.twinnet.gr/ http://www.twinnet.gr


From: gchristakis [mailto:[email protected]]
Sent: Monday, February 29, 2016 9:48 AM
To: shramov/leaflet-plugins
Cc: egmobile
Subject: Re: [leaflet-plugins] problem with loading KML files in ios (#207)

for the ios i had to tranform kml files to geojson files and load them as geojson
that was the only solution that i found


Reply to this email directly or view it on GitHub #207 (comment) . https://github.com/notifications/beacon/AQt_kWYgSiKdLUOpHJX3dVA9yLlgFihUks5pop2WgaJpZM4HCMni.gif

@egmobile
Copy link

egmobile commented Mar 3, 2016

In IOS I have tried the following (and variations of that) with no success. The json file is valid I have checked it.

var myLayer = new L.GeoJSON().addTo(map);

myLayer.addData("file.geojson");

If you do have some suggestions, I would appreciate. Thanks in advance.

--Dimitris

From: gchristakis [mailto:[email protected]]
Sent: Monday, February 29, 2016 9:48 AM
To: shramov/leaflet-plugins
Cc: egmobile
Subject: Re: [leaflet-plugins] problem with loading KML files in ios (#207)

for the ios i had to tranform kml files to geojson files and load them as geojson
that was the only solution that i found


Reply to this email directly or view it on GitHub #207 (comment) . https://github.com/notifications/beacon/AQt_kWYgSiKdLUOpHJX3dVA9yLlgFihUks5pop2WgaJpZM4HCMni.gif

@tatsubori
Copy link

You may need security settings to allow the app to fetch from external resources in iOS.

Regards,

Mich

Michiaki Tatsubori, PhD.
IBM Research - Africa

Sent from my iPhone

On Mar 4, 2016, at 08:59, egmobile [email protected] wrote:

In IOS I have tried the following (and variations of that) with no success. The json file is valid I have checked it.

var myLayer = new L.GeoJSON().addTo(map);

myLayer.addData("file.geojson");

If you do have some suggestions, I would appreciate. Thanks in advance.

--Dimitris

From: gchristakis [mailto:[email protected]]
Sent: Monday, February 29, 2016 9:48 AM
To: shramov/leaflet-plugins
Cc: egmobile
Subject: Re: [leaflet-plugins] problem with loading KML files in ios (#207)

for the ios i had to tranform kml files to geojson files and load them as geojson
that was the only solution that i found


Reply to this email directly or view it on GitHub #207 (comment) . https://github.com/notifications/beacon/AQt_kWYgSiKdLUOpHJX3dVA9yLlgFihUks5pop2WgaJpZM4HCMni.gif


Reply to this email directly or view it on GitHub.

@egmobile
Copy link

egmobile commented Mar 5, 2016

Thank you Mich, we will check that. Basically we use Cordova to generate the build and in Android we use the same Js code which works fine.

Regards,

--Dimitris Doukas


logo

Dr. Dimitris Doukas

General Manager Twin Net Information Systems Ltd

Mob: +30.6944.964310

Phone: +30.210.6857070, +30.210-6090451

Fax: +30.210.6857070

Web: http://www.twinnet.gr/ http://www.twinnet.gr


From: tatsubori [mailto:[email protected]]
Sent: Friday, March 04, 2016 2:22 AM
To: shramov/leaflet-plugins
Cc: egmobile
Subject: Re: [leaflet-plugins] problem with loading KML files in ios (#207)

You may need security settings to allow the app to fetch from external resources in iOS.

Regards,

Mich

Michiaki Tatsubori, PhD.
IBM Research - Africa

Sent from my iPhone

On Mar 4, 2016, at 08:59, egmobile [email protected] wrote:

In IOS I have tried the following (and variations of that) with no success. The json file is valid I have checked it.

var myLayer = new L.GeoJSON().addTo(map);

myLayer.addData("file.geojson");

If you do have some suggestions, I would appreciate. Thanks in advance.

--Dimitris

From: gchristakis [mailto:[email protected]]
Sent: Monday, February 29, 2016 9:48 AM
To: shramov/leaflet-plugins
Cc: egmobile
Subject: Re: [leaflet-plugins] problem with loading KML files in ios (#207)

for the ios i had to tranform kml files to geojson files and load them as geojson
that was the only solution that i found


Reply to this email directly or view it on GitHub #207 (comment) . https://github.com/notifications/beacon/AQt_kWYgSiKdLUOpHJX3dVA9yLlgFihUks5pop2WgaJpZM4HCMni.gif


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub #207 (comment) . https://github.com/notifications/beacon/AQt_kRPUcoSuECTnQwd-_AKKLZHibLAZks5pp3sNgaJpZM4HCMni.gif

@brunob brunob added the question label Mar 7, 2016
@cicerohellmann
Copy link

Some one solved this issue?

@egmobile
Copy link

Hi, no, as far as I know. I have tried almost everything suggested with no success.

--Dimitris Doukas

From: cicerohellmann [mailto:[email protected]]
Sent: Tuesday, May 31, 2016 9:12 PM
To: shramov/leaflet-plugins
Cc: egmobile; Comment
Subject: Re: [shramov/leaflet-plugins] problem with loading KML files in ios (#207)

Some one solved this issue?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #207 (comment) , or mute the thread https://github.com/notifications/unsubscribe/AQt_kfhB9Iu8okpebkcqBhj_OM4Yl4Ofks5qHHnzgaJpZM4HCMni . https://github.com/notifications/beacon/AQt_kZUX8VvXq1i26lBGW8IAuLzS_tdfks5qHHnzgaJpZM4HCMni.gif

@cicerohellmann
Copy link

cicerohellmann commented May 31, 2016

There goes my init function, the file that I'm using is just a kml file translated to geojson. If you need any further help, I can guide you. I'm also using this plugin: leaflet-ajax-gh-pages/leaflet.ajax.js

function initMap() {

var southWest = L.latLng(3.639518, -74.970703),
northEast = L.latLng(-35.643905, -32.607422),
bounds = L.latLngBounds(northEast, southWest);

map = new L.Map('map', {center: new L.LatLng(58.4, 43.0), zoom: 5, maxBounds: bounds});
var osm = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
});

map.addLayer(osm);


// Variable for your data
var geojsonData;

// Fetch the file
$.getJSON('kml/GeoJson.geojson', function (results) {
    // Assign the results to the geojsonData variable
    geojsonData = results;

    L.geoJson(geojsonData).addTo(map);
  });


getCheckPoints();
map.addLayer(markers);
map.locate();
userLocation = L.control.locate().addTo(map);
userLocation.start();
hideLoading();

// lc.stop();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants