Good day, thanks a lot, all u do is SUPER
my question: is there a way to show (hide) new markers on a map instantly dont refresh site (maybe a plugin or ajax+jqeury??)
Thanks
Instant markers changes on a Map
- Jan
- Phoca Hero
- Posts: 48610
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Instant markers changes on a Map
Hi, not sure if I understand your question correctly?
Do you mean, that when you add new marker in administration, such will be displayed in frontend automatically? Mostly when you add new marker, all users will load the page after that, so not sure, if there should be such option?
Jan
Do you mean, that when you add new marker in administration, such will be displayed in frontend automatically? Mostly when you add new marker, all users will load the page after that, so not sure, if there should be such option?
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 9
- Joined: 05 Nov 2018, 06:14
Re: Instant markers changes on a Map
Yes, u understand absolutly right. but i need that a user during watching the map could see apeareance of new markers (or disapear)
without reloading the website. (just like when u use whatsapp for example)
maybe such kind of a code will do this, but i dont understand where to past it in joomla (i think somehow in article) but ists eror
becouse plugin uses {....} element (perhapse)
this is code to publish time (for example)
without reloading the website. (just like when u use whatsapp for example)
maybe such kind of a code will do this, but i dont understand where to past it in joomla (i think somehow in article) but ists eror
becouse plugin uses {....} element (perhapse)
Code: Select all
<body>
<div id="content"></div>
<script>
function show()
{
$.ajax({
[color=#FFBF00] url: "time.php", [/color]
cache: false,
success: function(html){
$("#content").html(html);
}
});
}
$(document).ready(function(){
show();
setInterval('show()',1000);
});
</script>
</body>
this is code to publish time (for example)
- Jan
- Phoca Hero
- Posts: 48610
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Instant markers changes on a Map
Hi, unfortunately, I have no experiences with such feature, so hard to say. In general, you need to use some AJAX function. The problem is how to recreate Javascript code, as the map is rendered by Javascript. So for this you need to see maps API to add dynamically the markers. The AJAX function just asks for the markers and you need to do some comparing function - between new and old markers, so only new are added to the map 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 9
- Joined: 05 Nov 2018, 06:14
Re: Instant markers changes on a Map
Good day!
Maybe there is another way?
as I understand plugin shows the map in joomla artical.
what if to update only this plugin.
i had some tries but i failed. perhaps i wrote wrong path. (my sript dont understand what to do)
Maybe there is another way?
as I understand plugin shows the map in joomla artical.
what if to update only this plugin.
i had some tries but i failed. perhaps i wrote wrong path. (my sript dont understand what to do)
Code: Select all
<!DOCTYPE html>
<html lang="en">
<?php
include 'includes/head.php'; ?>
<body>
<!-- <script>
function show()
{
jQuery.ajax({
type: "GET",
[color=#FFFF00]JURI::base().'plugins/content/phocamaps/phocamaps.php',[/color]
cache: false,
success: function(html){
jQuery("#phocaMapPlgPM1").html(html);
}
});
}
jQuery(document).ready(function(){
show();
setInterval('show()',1000);
}); </script>-->
- Jan
- Phoca Hero
- Posts: 48610
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Instant markers changes on a Map
Hi, it does not matter where the map is displayed, the data are all stored in database. So when rendering the map, the Javascript which renders the map, get all the information from the Joomla! database (Phoca Maps tables) prepered by PHP functions. 
Jan

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