Jump to content

kml-files to Wordpress: the integration of openstreetmap into the wordpress-framework


Recommended Posts

hello and good evening 

the question of the day_ kml-files to Wordpress: the integration of openstreetmap into the wordpress-framework

i am working on  the integration of several maps. 

i download them here:  https://export.hotosm.org/

eg. as kml 

note here we have the following File Formats  

see each file format.
GeoPackage .gpkg
Shapefile .shp
Garmin .img
Google Earth .kml
OSM .pbf
MAPS.ME .mwm
OsmAnd .obf
MBTiles .mbtiles


well which one is appropiate - which one to choose!? 

well finally i want to upload .kml files to WordPress. I am currently planning to add the maps to  WordPress 

my guesses: For KML/KMZ files to be properly supported, we'll have to use text/xml and application/zip instead,  kml is detected as text/xml and not application/xml, changing the code accordingly should resolve the issue described in the comments below. well i think that WordPress compares the declared MIME type to the 'real' detected MIME type (see function wp_check_filetype_and_ext in wp-includes/functions.php for more details)


so the question is: can we do this integration like so


 

add_filter('upload_mimes', 'add_upload_mimes');

function add_upload_mimes($mimes) {
  $mimes['kml'] = 'text/xml';
  $mimes['kmz'] = 'application/zip';
  return $mimes;
}
add_filter('upload_mimes', 'add_upload_mimes');


what do you say - does this work propperly

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.