Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

There were some problems, we've fixed. Please try to open app again.

Don
Posts: 0
Joined: Sun Feb 17, 2013 4:09 pm

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

Hi Katya,

The app is no longer freezing and displaying the white page...
but there is also still no mapping working.

Looking at the JS, it is all messed up now:

precode
googleMapDiv = Tiggzi("googlemap1_2")&#46;get(0);&#xd;$googleMapDiv = $(googleMapDiv);&#xd;mapWidth = $googleMapDiv&#46;width();&#xd;mapHeight = $googleMapDiv&#46;height();&#xd;&#xd;&#47;Adjust zoom to cover all marks&#47;&#xd;function log2(m) {&#xd;return ((Math&#46;log(m)) &#47; (Math&#46;log(2)));&#xd;};&#xd;var maxLatitude = -90,&#xd;minLatitude = 90,&#xd;maxLongitude = -180,&#xd;minLongitude = 180,&#xd;location, widthForZoom0 = 256,&#xd;&#47;map width&#47;height = 256px for zoom = 0&#47;&#xd;mapWidth, mapHeight, mapDivZoom, mapZoom, resultZoom, googleMapDiv, $googleMapDiv, mapOptions, map, i, sfLatlng, marker;&#xd;for (i = 0; i < value&#46;length; i++) {&#xd;location = value['location'];&#xd;maxLatitude = location['latitude'] > maxLatitude ? location['latitude'] : maxLatitude;&#xd;minLatitude = location['latitude'] < minLatitude ? location['latitude'] : minLatitude;&#xd;maxLongitude = location['longitude'] > maxLongitude ? location['longitude'] : maxLongitude;&#xd;minLongitude = location['longitude'] < minLongitude ? location['longitude'] : minLongitude;&#xd;};&#xd;mapZoom = log2(1 &#47; Math&#46;max(Math&#46;abs((maxLatitude - minLatitude) &#47; 180), Math&#46;abs((maxLongitude - minLongitude) &#47; 360))); &#47;zoom for current map piece&#47;&#xd;mapDivZoom = log2(Math&#46;min(mapWidth, mapHeight) &#47; widthForZoom0); &#47;zoom for current size of map div&#47;&#xd;resultZoom = Math&#46;floor(mapDivZoom + mapZoom); &#47;result map zoom&#47;&#xd;if (resultZoom > 15) {&#xd;resultZoom = 15;&#xd;}&#xd;if (resultZoom < 0) {&#xd;resultZoom = 0;&#xd;}&#xd;mapOptions = {&#xd;zoom: resultZoom,&#xd;center: new google&#46;maps&#46;LatLng((maxLatitude + minLatitude) &#47; 2, (maxLongitude + minLongitude) &#47; 2),&#xd;mapTypeId: google&#46;maps&#46;MapTypeId&#46;ROADMAP&#xd;};&#xd;&#xd;&#47;Add marks to screen&#47;&#xd;map = new google&#46;maps&#46;Map(googleMapDiv, mapOptions);&#xd;for (i = 0; i < value&#46;length; i++) {&#xd;sfLatlng = new google&#46;maps&#46;LatLng(value['location']['latitude'], value['location']['longitude']);&#xd;marker = new google&#46;maps&#46;Marker({&#xd;position: sfLatlng,&#xd;map: map&#xd;});&#xd;};&#xd;
/code/pre

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

Hi Don,
Yes, this is a known editor problem. There should be new lines instead of code"&#xd;"/code
Replace them manually and mapping should work.

Don
Posts: 0
Joined: Sun Feb 17, 2013 4:09 pm

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

Replaced &#xd; with returns and now the app returns the white page again and hangs.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

Hello!

You should change mapping on LocationMap page ( REST_4locations Response) - map LOCATION to JavaScript mapJS, not LOCATIONS

Here is the JS code:

code googleMapDiv = Tiggzi("googlemap1_2")&#46;get(0);
$googleMapDiv = $(googleMapDiv);
mapWidth = $googleMapDiv&#46;width();
mapHeight = $googleMapDiv&#46;height(); &#47;Adjust zoom to cover all marks&#47;

Code: Select all

             function log2(m) { 
                 return ((Math&#46;log(m)) &#47; (Math&#46;log(2))); 
             }; 
             var maxLatitude = -90, 
                 minLatitude = 90, 
                 maxLongitude = -180, 
                 minLongitude = 180, 
                 location, widthForZoom0 = 256, 
                 &#47;*map width&#47;height = 256px for zoom = 0*&#47; 
                 mapWidth, mapHeight, mapDivZoom, mapZoom, resultZoom, googleMapDiv, $googleMapDiv, mapOptions, map, i, sfLatlng, marker; 
             for (i = 0; i < value&#46;length; i++) { 
                 location = value[i]; 
                 maxLatitude = +location['LATITUDE'] > maxLatitude ? +location['LATITUDE'] : maxLatitude; 
                 minLatitude = +location['LATITUDE'] < minLatitude ? +location['LATITUDE'] : minLatitude; 
                 maxLongitude = +location['LONGITUDE'] > maxLongitude ? +location['LONGITUDE'] : maxLongitude; 
                 minLongitude = +location['LONGITUDE'] < minLongitude ? +location['LONGITUDE'] : minLongitude; 
             }; 
             mapZoom = log2(1 &#47; Math&#46;max(Math&#46;abs((maxLatitude - minLatitude) &#47; 180), Math&#46;abs((maxLongitude - minLongitude) &#47; 360))); &#47;*zoom for current map piece*&#47; 
             mapDivZoom = log2(Math&#46;min(mapWidth, mapHeight) &#47; widthForZoom0); &#47;*zoom for current size of map div*&#47; 
             resultZoom = Math&#46;floor(mapDivZoom + mapZoom); &#47;*result map zoom*&#47; 
             if (resultZoom > 15) { 
                 resultZoom = 15; 
             } 
             if (resultZoom < 0) { 
                 resultZoom = 0; 
             } 
             mapOptions = { 
                 zoom: resultZoom, 
                 center: new google&#46;maps&#46;LatLng((maxLatitude + minLatitude) &#47; 2, (maxLongitude + minLongitude) &#47; 2), 
                 mapTypeId: google&#46;maps&#46;MapTypeId&#46;ROADMAP 
             }; &#47;*Add marks to screen*&#47; 
             map = new google&#46;maps&#46;Map(googleMapDiv, mapOptions); 
             for (i = 0; i < value&#46;length; i++) { 
                 sfLatlng = new google&#46;maps&#46;LatLng(value[i]['LATITUDE'], value[i]['LONGITUDE']); 
                 marker = new google&#46;maps&#46;Marker({ 
                     position: sfLatlng, 
                     map: map 
                 }); 
             }; 

/code

Don
Posts: 0
Joined: Sun Feb 17, 2013 4:09 pm

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

Sorry, as soon as the XML is returned, I still get a blank white page and endless wait circle.

If I remove the JS, the page returns correctly, including the webservice response/locations being populated.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

Hello! Did you follow instructions I've suggested above?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to add custom icons for Geolocation Marker & Multiple Location Points? I will pay for a good answer.

You should delete mapping from LOCATIONS and replace code with the code I've suggested above https://getsatisfaction.com/tiggzi/to...

You have incorrect JS

Return to “Issues”