Khtml.maplib

From OpenStreetMap Wiki
Jump to: navigation, search

khtml.maplib is a javascript library for browser maps like Google Maps API, Bing Map API and Openlayers. Licence is the business friendly LGPL.

Quickstart for Copy/Paste

<div id="map" style="width:800px;height:500px"> </div>
<script type="text/javascript" src="http://maplib.khtml.org/khtml.maplib/khtml_all.js"> </script>
<script type="text/javascript" > 
var map=khtml.maplib.Map(document.getElementById("map"));
map.centerAndZoom(new khtml.maplib.LatLng(38.430946615106265,13.238569903377112),1) //latitude, longitude, zoom
</script>

Code Generator

http://maplib.khtml.org/

Capabilities

Bitmap

  • Tiled maps as mapnic, osma, cyclemap
  • Overlays like hillshade, openseamap

Markers

see Simple_marker_API

Vectors

Native Vector Format is GeoJSON combined with CSS. SVG, Canvas and VML are supported as Backend. see Simple_overlay_API

Programming

see Simple_map_API

Principles

The programming API provides a minimum of methods to have complete control over map and overlays.

  • no id's
  • no innerHTML if not really needed
  • no external library
  • library fits into one file
  • Speed is important


Resources

Mailing list: khtml.maplib@freelists.org

Repository: https://github.com/robotnic/khtml.maplib

Blog: http://maplib.khtml.org/wordpress/