• Nelson-Benavides
  • NEWBIE
  • 10 Points
  • Member since 2014
  • Developer
  • unWired Broadband Inc.

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi there,

My map uses width="100%" so when users use the mouse wheel to scroll down, they get "stuck" on the map zooming in and out.

In JavaScript you simply set scrollwheel: false but I'm using <apex:map> as follows:

<apex:map width="100%" height="400px" mapType="roadmap" center="{.....}">

Articles such as: https://www.salesforce.com/docs/developer/pages/Content/pages_compref_map.htm say: "Display an interactive, JavaScript-based map, complete with zooming, scrolling, and markers based on your Salesforce or other data.", but, what's the scrolling attribute?

I tried scrolling="false", scroll="false", scrollwheel="false" and nothing. I don't seem to find this option.

Any help I would appreciate it.

Thanks,

--Nelson.
Hello all,

First I apologize if this has been discussed here already. I searched everywhere here and I don't seem to find what I'm trying to accomplish.

I have a Visualforce page integrated with Google Maps using API v3. I had it all working fine for awhile until we had to change the field from where we were getting the GPS coordinates.

We used to have a text field were we manually entered the GPS coordinates (both latitude and longitude) in decimal format. I had all the code to split the coordinates and make sure there was a comma in between.. etc.., all working fine.

The problem now is that instead of using the text field, we had to use the Geolocation field (data type). As you know, this is one field at the Opportunity displaying both lat and lon. When trying to input the coordinates you have to edit the page and enter lat and lon in 2 different fields.

I have changed my code to use the Geolocation field instead, but now it doesn't display the map on the VF page.

I had the code like this when using the text field (which was working just fine):
...
var latlngString = "{!Opportunity.GPS_Coordinates__c}";
     var temp = latlngString.split(',', 2);
     var lat = parseFloat(temp[0]);
     var lng = parseFloat(temp[1]);
     var latlng = new google.maps.LatLng(lat, lng);
...

The new Geolocation field is named: GPS_Location

Now that we are using the Geolocation field, I cannot do this anymore:
...
var latlngString = "{!Opportunity.GPS_Location__c}";
...
The line above gives me an error saying: "Data type not supported"

Then I read somewhere else that the latitude and longitude values can be accessed as field-name__Latitude__s and field-name__Longitude__s

So I did this:
...
var lat = {!Opportunity.GPS_Location__Latitude__s};
var lng = {!Opportunity.GPS_Location__Longitude__s};
var latlng = new google.maps.LatLng(lat, lng);
...
No errors at this point but the map is not displayed.

I'm not sure if the variables lat and lng are actually getting the coordinates.

I'm not using any custom controllers or anything, just the standardController="Opportunity"

What am I missing?

Any help I would appreciate it.

Thanks in advance.

--Nelson.
Hi there,

I already have all the code working, but at the end I don't need to insert all the content of the String variable.

Suppose you have a String variable called: temp --- and this variable contains the following text:

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
abc abc abc
defghi
jklmnopq 1234 56789

"Start"
More text More text More text More text More text More text More text More text More text More text More text
"End"

1234567890123456 Text Text Text Text Text Text Text Text
More Text Text Text Text Text Text
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

I only need to "extract" or "insert" the text that is between "Start" and "End" instead of inserting everything.

How do I do this? What method(s) and/or Functions could I use?

Thanks in advance.

--Nelson.
Hello all,

First I apologize if this has been discussed here already. I searched everywhere here and I don't seem to find what I'm trying to accomplish.

I have a Visualforce page integrated with Google Maps using API v3. I had it all working fine for awhile until we had to change the field from where we were getting the GPS coordinates.

We used to have a text field were we manually entered the GPS coordinates (both latitude and longitude) in decimal format. I had all the code to split the coordinates and make sure there was a comma in between.. etc.., all working fine.

The problem now is that instead of using the text field, we had to use the Geolocation field (data type). As you know, this is one field at the Opportunity displaying both lat and lon. When trying to input the coordinates you have to edit the page and enter lat and lon in 2 different fields.

I have changed my code to use the Geolocation field instead, but now it doesn't display the map on the VF page.

I had the code like this when using the text field (which was working just fine):
...
var latlngString = "{!Opportunity.GPS_Coordinates__c}";
     var temp = latlngString.split(',', 2);
     var lat = parseFloat(temp[0]);
     var lng = parseFloat(temp[1]);
     var latlng = new google.maps.LatLng(lat, lng);
...

The new Geolocation field is named: GPS_Location

Now that we are using the Geolocation field, I cannot do this anymore:
...
var latlngString = "{!Opportunity.GPS_Location__c}";
...
The line above gives me an error saying: "Data type not supported"

Then I read somewhere else that the latitude and longitude values can be accessed as field-name__Latitude__s and field-name__Longitude__s

So I did this:
...
var lat = {!Opportunity.GPS_Location__Latitude__s};
var lng = {!Opportunity.GPS_Location__Longitude__s};
var latlng = new google.maps.LatLng(lat, lng);
...
No errors at this point but the map is not displayed.

I'm not sure if the variables lat and lng are actually getting the coordinates.

I'm not using any custom controllers or anything, just the standardController="Opportunity"

What am I missing?

Any help I would appreciate it.

Thanks in advance.

--Nelson.
Hi there,

I already have all the code working, but at the end I don't need to insert all the content of the String variable.

Suppose you have a String variable called: temp --- and this variable contains the following text:

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
abc abc abc
defghi
jklmnopq 1234 56789

"Start"
More text More text More text More text More text More text More text More text More text More text More text
"End"

1234567890123456 Text Text Text Text Text Text Text Text
More Text Text Text Text Text Text
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

I only need to "extract" or "insert" the text that is between "Start" and "End" instead of inserting everything.

How do I do this? What method(s) and/or Functions could I use?

Thanks in advance.

--Nelson.