{"id":23278903,"url":"https://github.com/gitoido/custom-map-form-type-bundle","last_synced_at":"2025-04-06T12:43:10.772Z","repository":{"id":62546634,"uuid":"80600647","full_name":"gitoido/custom-map-form-type-bundle","owner":"gitoido","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-13T08:13:40.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T18:39:58.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/gitoido.png","metadata":{"files":{"readme":"README.md","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":"2017-02-01T08:11:22.000Z","updated_at":"2017-02-01T08:11:58.000Z","dependencies_parsed_at":"2022-11-02T22:15:22.381Z","dependency_job_id":null,"html_url":"https://github.com/gitoido/custom-map-form-type-bundle","commit_stats":null,"previous_names":["gitoido/custom-map-form-type-bundle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitoido%2Fcustom-map-form-type-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitoido%2Fcustom-map-form-type-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitoido%2Fcustom-map-form-type-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitoido%2Fcustom-map-form-type-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitoido","download_url":"https://codeload.github.com/gitoido/custom-map-form-type-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485293,"owners_count":20946397,"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-12-19T22:37:42.360Z","updated_at":"2025-04-06T12:43:10.749Z","avatar_url":"https://github.com/gitoido.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CustomMapFormTypeBundle\n\nSet the latitude and longitude using Custom Map\n\n## Installation\n\nAdd warezgibzzz/custom-map-form-type-bundle to your `composer.json` file and run `composer`\n\n```json\n...\n\"require\": {\n    \"warezgibzzz/custom-map-form-type-bundle\": \"dev-master\"\n}\n...\n```\n\nRegister the bundle in your `AppKernel.php`\n\n```php\n...\nnew Warezgibzzz\\CustomMapFormTypeBundle\\WarezgibzzzCustomMapFormTypeBundle(),\n...\n```\n\nInclude bundle's scripts in your page:\n\n```html\n...\n\u003cscript src=\"{{ asset('bundles/warezgibzzzcustommapformtype/js/imgViewer.min.js') }}\"\u003e\u003c/script\u003e\n\u003cscript src=\"{{ asset('bundles/warezgibzzzcustommapformtype/js/imgNotes.min.js') }}\"\u003e\u003c/script\u003e\n\u003cscript src=\"{{ asset('bundles/warezgibzzzcustommapformtype/js/custom_map_widget.js') }}\"\u003e\u003c/script\u003e\n...\n```\n\n## Usage\n\nJust set the `custom_map` FormType for your field as follows:\n\n```php\n...\n    -\u003eadd('coordinates', 'custom_map')\n...\n```\n\nThe type takes and returns an array with items `lat` for the latitude and `lng` for the longitude. So you need to\nconfigure your database coordinates column as `OBJECT` or create the setter and getter for it on your model.\n\n## Options\n\nThere are a few options that you can pass:\n\n```php\n...\n    -\u003eadd('coordinates', 'custom_map', array(\n        'width'      =\u003e 640,      // The map's width\n        'height'     =\u003e 480,      // The map's height\n        'default'    =\u003e array(\n            'x' =\u003e 5, // The default latitude value\n            'y' =\u003e 6 // The default longitude value\n        ),\n        'parameters' =\u003e array(\n            'image' =\u003e 'http://placehold.it/640x480', // The map image\n        )\n    ))\n...\n```\n\n## Configuration\n\nYou can configure default values for type's options to avoid passing them every time:\n\n```yml\n...\nwarezgibzzz_custom_map_form_type:\n    size:\n        width:  640\n        height: 480\n    default:\n        x: 5\n        y: 6\n    parameters:\n        image: 'custom#map'\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitoido%2Fcustom-map-form-type-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitoido%2Fcustom-map-form-type-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitoido%2Fcustom-map-form-type-bundle/lists"}