Web Component: j-MapMarker
j-MapMarker (BETA)
- jComponent
v19 path="target.property"can contain GPS48.727903,19.157763or textViestova 28, Banská Bystrica, Slovakia- two way binding works with GPS (so the component returns GPS coordinates into the model when the
textis used instead of GPS)
Google API:
- allow
geometryservices
Configuration:
key{String}IMPORTANT Google API keytype{String}needs to contain a map type (roadmap(default),satellite,hybrid,terrain)draggable{Boolean}for drag & drop marker (default:false)zoom{Number}, default13autocomplete{Boolean}enables auto-complete API (default:falseand input must be attached bymapmarker/autocompletemethod)iconneeds to contain a URL to a new icon markeranimationneeds to contain a animation type (bounceanddrop)darkmode{Boolean}enables dark mode (default:false)parent{String}jQuery selector which will be used asheightcontainer (default:auto)height{Number}height of the map (default:undefined)heightlg{Number}height of the map (default:undefined)heightmd{Number}height of the map (default:undefined)heightsm{Number}height of the map (default:undefined)heightxs{Number}height of the map (default:undefined)margin{Number}top/bottom margin of the map (default:0)marginlg{Number}top/bottom margin of the map (default:undefined)marginmd{Number}top/bottom margin of the map (default:undefined)marginsm{Number}top/bottom margin of the map (default:undefined)marginxs{Number}top/bottom margin of the map (default:undefined)markerwidth{Number}marker width, default40markerheight{Number}marker height, default:50markeroffsetx{Number}marker X offset, default1markeroffsety{Number}marker Y offset, default:0infox{Number}label offset Y, default:0infoy{Number}label offset X, default:0labelopacity{Number}marker label opacity, default:0.75markercluster{Boolean}enables marker clusterer (default:true)onposition{String}a path tofunction(component, visible_markers)- evaluated when the position on the map is changedonready{String}a path tofunction(component)- evaluated when the map is ready to use
Methods:
component.autocomplete(input)input for autocompletecomponent.clear()Removes all markerscomponent.add(opt)Adds markeropt.iconURL address to iconopt.gps{String}GPS positionopt.center{Boolean}centers the map to this positionopt.tooltip{String}tooltip for the markeropt.callback{Function(opt)} triggered when the marker is addedopt.onclick{Function(opt)} triggered when the user clicks on the markeropt.onposition{Function(opt)} triggered when the user changes the position of the map- IMPORTANT:
optwill be extendend by adding methods:opt.remove(),opt.setIcon(url),opt.setPosition(gps),opt.setVisible(boolean)and properties:opt.element,opt.marker,opt.mapandopt.zoom
Author
- Peter Širka petersirka@gmail.com
- License
Created
01. december 2020
Updated
05. august 2025
jComponent library
19
Version
v1
License
https://www.totaljs.com/license/
Responsive
Yes
Author
Peter Širka
Email
petersirka@gmail.com

