Map OMS et Marker

Phoca Maps - displaying maps in Joomla! CMS
Digiduck
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 20 Sep 2018, 16:28

Map OMS et Marker

Post by Digiduck »

Hello

I have a little problem with the markers on an OSM board. When I activate a marker on the map, it does not appear, if I remove it, the map is displayed.
In my javascript console I have an unexpected EOF on a line:

Code: Select all

                markerPlgPM1m3.bindPopup('<div style="width: 30px;height: 30px;">
Here is the complete script as it appears in the console :

Code: Select all

jQuery(document).ready(function() {
                var mapphocaMapPlgPM1 = L.map("phocaMapPlgPM1", {scrollWheelZoom: false,}).setView([46.603354, 1.8883335], 6);
                L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {
                maxZoom: 20,
                attribution: '&copy; <a href="https://www.openstreetmap.fr" target="_blank">Openstreetmap France</a> & <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>'
                }).addTo(mapphocaMapPlgPM1);
                var markerPlgPM1m3 = L.marker([46.9280709983179, 3.29032290855661]).addTo(mapphocaMapPlgPM1);
                markerPlgPM1m3.bindPopup('<div style="width: 30px;height: 30px;">
                    <div style="font-size:120%;margin: 5px 0px;font-weight:bold;">58160</div>
                    <div>
                    </div>
                </div>').openPopup();
                var iconPlgPM1m3 = new L.AwesomeMarkers.icon({
                icon: "circle",
                markerColor: "blue",
                iconColor: "#ffffff",
                prefix: "glyphicon",
                spin: 0,
                extraClasses: "",
                })
                markerPlgPM1m3.setIcon(iconPlgPM1m3);
                mapphocaMapPlgPM1.addControl(
                new L.Control.Fullscreen({
                position: 'topright',
                title: {
                'false': 'View Fullscreen',
                'true': 'Exit Fullscreen'
            }
            })
            )
            L.control.locate({
            position: 'topright',
            strings: {
            'title': 'Current Position'
            },
            locateOptions: {
            enableHighAccuracy: true,
            watch: true,
        }
        }).addTo(mapphocaMapPlgPM1);
        mapphocaMapPlgPM1.addControl(new L.Control.Search({
        url: 'https://nominatim.openstreetmap.org/search?format=json&q={s}',
        jsonpParam: 'json_callback',
        propertyName: 'display_name',
        propertyLoc: ['lat','lon'],
        marker: L.circleMarker([0,0],{radius:30}),
        autoCollapse: true,
        autoType: false,
        minLength: 3,
        position: 'topleft',
        }));
        mapphocaMapPlgPM1.addControl(
        new L.easyPrint({
        hideControlContainer: true,
        sizeModes: ['Current', 'A4Portrait', 'A4Landscape'],
        position: 'topleft',
        exportOnly: true
        })
        );
        })
JCEMediaBox.init({popup:{width:"",height:"",legacy:0,lightbox:0,shadowbox:0,resize:1,icons:0,overlay:1,overlayopacity:0.8,overlaycolor:"#000000",fadespeed:500,scalespeed:500,hideobjects:0,scrolling:"fixed",close:2,labels:{'close':'Fermer','next':'Suivant','previous':'Précédent','cancel':'Annuler','numbers':'{$current} sur {$total}'},cookie_expiry:"",google_viewer:0},tooltip:{className:"tooltip",opacity:0.8,speed:150,position:"br",offsets:{x: 16, y: 16}},base:"/",imgpath:"plugins/system/jcemediabox/img",theme:"standard",themecustom:"",themepath:"plugins/system/jcemediabox/themes",mediafallback:0,mediaselector:"audio,video"});
jQuery(function($){ initTooltips(); $("body").on("subform-row-add", initTooltips); function initTooltips (event, container) { container = container || document;$(container).find(".hasTooltip").tooltip({"html": true,"container": "body"});} });
jQuery(function($){ initPopovers(); $("body").on("subform-row-add", initPopovers); function initPopovers (event, container) { $(container || document).find(".hasPopover").popover({"html": true,"trigger": "hover focus","container": "body"});} });
Digiduck
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 20 Sep 2018, 16:28

Re: Map OMS et Marker

Post by Digiduck »

Here is the complete script as it appears in the console when I remove the marker from the map:

Code: Select all

jQuery(document).ready(function(){var mapphocaMapPlgPM1=L.map("phocaMapPlgPM1",{scrollWheelZoom:false,}).setView([46.603354,1.8883335],6);L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',{maxZoom:20,attribution:'&copy; <a href="https://www.openstreetmap.fr" target="_blank">Openstreetmap France</a> & <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>'}).addTo(mapphocaMapPlgPM1);mapphocaMapPlgPM1.addControl(new L.Control.Fullscreen({position:'topright',title:{'false':'View Fullscreen','true':'Exit Fullscreen'}}))
L.control.locate({position:'topright',strings:{'title':'Current Position'},locateOptions:{enableHighAccuracy:true,watch:true,}}).addTo(mapphocaMapPlgPM1);mapphocaMapPlgPM1.addControl(new L.Control.Search({url:'https://nominatim.openstreetmap.org/search?format=json&q={s}',jsonpParam:'json_callback',propertyName:'display_name',propertyLoc:['lat','lon'],marker:L.circleMarker([0,0],{radius:30}),autoCollapse:true,autoType:false,minLength:3,position:'topleft',}));mapphocaMapPlgPM1.addControl(new L.easyPrint({hideControlContainer:true,sizeModes:['Current','A4Portrait','A4Landscape'],position:'topleft',exportOnly:true}));})
JCEMediaBox.init({popup:{width:"",height:"",legacy:0,lightbox:0,shadowbox:0,resize:1,icons:0,overlay:1,overlayopacity:0.8,overlaycolor:"#000000",fadespeed:500,scalespeed:500,hideobjects:0,scrolling:"fixed",close:2,labels:{'close':'Fermer','next':'Suivant','previous':'Précédent','cancel':'Annuler','numbers':'{$current} sur {$total}'},cookie_expiry:"",google_viewer:0},tooltip:{className:"tooltip",opacity:0.8,speed:150,position:"br",offsets:{x:16,y:16}},base:"/",imgpath:"plugins/system/jcemediabox/img",theme:"standard",themecustom:"",themepath:"plugins/system/jcemediabox/themes",mediafallback:0,mediaselector:"audio,video"});jQuery(function($){initTooltips();$("body").on("subform-row-add",initTooltips);function initTooltips(event,container){container=container||document;$(container).find(".hasTooltip").tooltip({"html":true,"container":"body"});}});jQuery(function($){initPopovers();$("body").on("subform-row-add",initPopovers);function initPopovers(event,container){$(container||document).find(".hasPopover").popover({"html":true,"trigger":"hover focus","container":"body"});}});</script>
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Map OMS et Marker

Post by Jan »

Hi, can I see the live site where it occurs?

Jan
If you find Phoca extensions useful, please support the project
Digiduck
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 20 Sep 2018, 16:28

Re: Map OMS et Marker

Post by Digiduck »

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Map OMS et Marker

Post by Jan »

Hi, I see, on that site, there is javascript error, but no additional information

First, try to disable this marker - so you know, tha map is working OK.
Then try to add some marker without any description - to see if there is no problem with description.

If this will not work, maybe another part of the webseit should be checked (if there is no error in Javascript in previously declared code - so specific modules and plugins are disabled for test, to see if it works OK without such plugins/modules :idea: )

Jan
If you find Phoca extensions useful, please support the project
Post Reply