{"id":15706865,"url":"https://github.com/threez/mapkit","last_synced_at":"2025-05-12T19:12:05.768Z","repository":{"id":56882735,"uuid":"510933","full_name":"threez/mapkit","owner":"threez","description":"MapsKit helps rendering tiles for google maps","archived":false,"fork":false,"pushed_at":"2014-12-12T07:44:44.000Z","size":299,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T19:11:59.139Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threez.png","metadata":{"files":{"readme":"Readme.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-02-10T08:44:40.000Z","updated_at":"2014-12-12T07:44:17.000Z","dependencies_parsed_at":"2022-08-20T13:10:46.379Z","dependency_job_id":null,"html_url":"https://github.com/threez/mapkit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fmapkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fmapkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fmapkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fmapkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threez","download_url":"https://codeload.github.com/threez/mapkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253805854,"owners_count":21967053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T20:29:50.119Z","updated_at":"2025-05-12T19:12:05.750Z","avatar_url":"https://github.com/threez.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MapKit \u0026 TileKit\n\nMapKit and TileKit are tools to help you develop a tile rendering service in\nruby. If you need to draw many markers in google maps then the performance\nlimit is reached fast. Google has advices to use up to 20 markers at a time.\nWith some tricks you can inrease the number of markes but with the cost of\ninprintability.\n\nIf you want to take the full power of google maps you might have to render\nyour own tile over the tiles of google. Like layers where your layer is on top\nof googles.\n\nThe system is very simple. You have to add a new Layer to your Google Maps that\nrequest a tile with X, Y and Z like this:\n\n    var layer = new GTileLayer(null, 0, 21, {\n      isPng: true,\n      opacity: 1\n    });\n    layer.getTileUrl = function(tile, zoom) {\n      return \"\" + zoom + \"/\" + tile.x + \"/\" + tile.y + \".png\";\n    }\n    map.addOverlay(new GTileLayerOverlay(layer));\n\nOnce this is done, google starts to request tiles from your server. To\nimplement the server you need to decode X (tile x), Y (tile y) and\nZ (zoom level) to a bounding box of latitude and longitude so that you can\ncheck what to draw in the tile that was requested. After you have fetched some\npoints you have to draw them in the Tile. This is where TileKit comes into play.\nTileKit relies on rmagick a well known image rendering library.\n\n    # this example assumes that a request with x, y and z was done\n    # by the browser and saved into x, y, z\n\n    POI = TileKit::Icon.new(\"images/poi.png\", [20, 20], [3, 20], [0, 0, 20, 17])\n    bounding_box = MapKit.bounding_box(x, y, z)\n\n    # search for points_of_interest in a bigger bouning box (grow by 10%)\n    points = DB.points(bounding_box.grow(10))\n\n    unless points.empty?\n      # cerate tile\n      tile = TileKit::Image.new(bounding_box)\n\n      # draw icons at point positions\n      for point in points do\n        tile.draw_icon(point, POI)\n      end\n\n      # return tile\n      return tile.png\n    end\n\nTo get an overview on the whole story checkout the sample application in the\nexample directory. It requires json, sequel, sqlite3 and sinatra.\n\n## Get started with an example\n\nTo try the example do the following, clone the git repository:\n\n    cd mapkit\n    bundle\n    cd example\n    ruby start.rb\n\nThen go to the webbrowser at http://localhost:4567/ and try it out. You will\nsee, how the tiles are rendered from the small sqlite database using rmagick.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fmapkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreez%2Fmapkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fmapkit/lists"}