0

Could someone provide an example of the most dirt simple method to force a new marker to pop up based on a given lat/lng?

I do not need js to write to my db, as that will be done server side; but I do want to display the new marker without refreshing the whole page. The UI will give a text input that gets geocoded and inserted into the table (e.g., string that will be located on google maps "123 seaside, any town, arzonia " . I just need that new point to be marked on the map as it stands. Again that client-side point won't be written anywhere, it's just added temporarily (until the map is hard refreshed again).

see http://highrank.robh71.com/map1/index.php

This page primitively demonstrates what I want to accomplish. Enter a new point or location, marker shows up without a reload. Geolocation already works, this is simply a display question. Currently I process data control via the sql api on a separate page for simplicity. This will obviously be changed! I'm really only concerned with the marker rather than the data update so let's pretend that the data write doesn't even matter.).

0

You don't need to refresh the whole page, you can refresh your map tiles independently. The best way to do this, is by adding the new point to your cartodb table via the SQL API. After this, you can refresh the map by doing sublayer[X].setSQL('SELECT * FROM your_table) - more info here - and your tiles will be shown with your new point.

Does this solve your problem?

  • i ended up doing it another way but i'm checking your answer because i'll probably use that in the near future :) . i did end up finally getting it to refresh altogether with invalidate() , however the time it takes would be bad on a site that had more data. – vaxhax Jan 17 '14 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.