Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Adding marker by clicking on map problem

Hi

I'm also using this code to select location from map and it sends the latlng of the last click to LVs nicely but the problem is that it still places markers every time I click

How to have it just moving the same marker .?

------

var placedMarkers = 0;
var availableMarkersToPlace = 1;
setTimeout( function(){
if(placedMarkers = availableMarkersToPlace)
return;
placedMarkers++;
var map = Appery("google_map").gmap;
google.maps.event.addListener(map, 'click', function(event) {
localStorage.setItem('myPos',event.LatLng);
placeMarker(event.latLng,map);

Code: Select all

 }); 

}, 1000);

---------
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Adding marker by clicking on map problem

Hello Misfer,

Please send a current location as a parameter of the function "placeMarker", instead of localStorage

Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Adding marker by clicking on map problem

Hi Sergiy,

I still need to send the selected location to localStorage because I need to use the value in different page .

Problem still not resolved

Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Adding marker by clicking on map problem

Any guideline to move the marker ?

-----

var placedMarkers = 0;
var availableMarkersToPlace = 1;
setTimeout( function(){
if(placedMarkers = availableMarkersToPlace)
return;
placedMarkers++;
var map = Appery("google_map").gmap;
google.maps.event.addListener(map, 'click', function(event) {
localStorage.setItem('myPos',event.LatLng);
placeMarker(event.latLng,map);

});

}, 1000);

---------
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Adding marker by clicking on map problem

Unfortunately this is something outside the scope of standard Appery.io platform support. You may consider purchasing Advisory Pack to get more in-depth help on this question. Here is more information about Advisory Pack (http://appery.io/services/#Advisory_Pack).

Please look at this topic how to do that:
http://stackoverflow.com/questions/66...

E.g. you can check the source of the http://www.kmcgraphics.com/google/ to get it's JS code

Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Adding marker by clicking on map problem

Thanks

Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Adding marker by clicking on map problem

Hi

Sorry for repeating the same question again but I really ran out of any solution for about a month now. I even published my app to Appstore and GooglePlay with this problem because I gave up on fixing it

I'm using this code to select location from map and it sends the latlng of the last click to LVs nicely but the problem is that it still places markers every time I click

How to have it just moving the same marker .?

------

var placedMarkers = 0;
var availableMarkersToPlace = 1;
setTimeout( function(){
if(placedMarkers = availableMarkersToPlace)
return;
placedMarkers++;
var map = Appery("google_map").gmap;
google.maps.event.addListener(map, 'click', function(event) {
localStorage.setItem('myPos',event.LatLng);
placeMarker(event.latLng,map);

});

}, 1000);

---------
Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Adding marker by clicking on map problem

Hello - we can provide you help with your app implementation through our Advisory Pack service: https://appery.io/services/

Misfer
Posts: 0
Joined: Mon Jul 18, 2016 11:41 am

Adding marker by clicking on map problem

Thanks - I found a workaround

Return to “Issues”