Khtml.maplib

From OpenStreetMap Wiki
Jump to navigation Jump to search
Logo.png
This page describes a historic artifact in the history of OpenStreetMap. It does not reflect the current situation, but instead documents the historical concepts, issues, or ideas.
About
This page describes a JavaScript library for slippy maps.
Reason for being historic
This project is dead. Its author recommends to use Leaflet instead.


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/